Skip to content

Conversation

@arvindKandpal-ksolves
Copy link
Contributor

Jira Link: CASSANDRA-21135

Description:
This PR fixes a regression in JMXFeatureTest caused by the recently introduced Async Profiler (CASSANDRA-20854).

Root Cause:
The AsyncProfilerService.status() method was throwing an IllegalStateException when the profiler was disabled (default state). During the JMXFeatureTest, the node restart process triggers JMX discovery/validation. When the test probe accessed the AsyncProfilerMBean status, the exception caused the test to fail.

Fix:

  • Modified AsyncProfilerService.status() to return a descriptive String message ("Async Profiler is not enabled...") instead of throwing an exception when disabled.
  • This adheres to better JMX practices where attribute getters should be side-effect free and not throw exceptions for valid states (like being disabled).
  • Updated AsyncProfilerServiceTest to assert the message string instead of expecting an exception.

Verification:

  • Verified locally that org.apache.cassandra.distributed.test.jmx.JMXFeatureTest passes.
  • Verified that org.apache.cassandra.service.AsyncProfilerServiceTest passes.

patch by Arvind Kandpal; for CASSANDRA-21135

@smiklosovic
Copy link
Contributor

cc @bbotella

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants