arvindKandpal-ksolves opened a new pull request, #4585:
URL: https://github.com/apache/cassandra/pull/4585
**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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]