Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x fix status from deadlock health check if invoking the MBean fails #9694

Merged

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Jan 24, 2025

Description

Resolves #9691

Release Note


Helidon's built-in deadlock health check now reports the state ERROR instead of DOWN if the invocation of the MBean method to retrieve deadlocked thread IDs throws an exception. (It used to report DOWN.)

Reporting ERROR is more accurate, and in such cases Helidon returns the HTTP status 500 for the health response. This lets a deployment environment, such as Kubernetes, allow the pod to continue running. In such error cases Helidon (as it has for some time) logs a TRACE-level message reporting the exception it encountered.


The code for the deadlock health check used to report DOWN if it failed to invoke the threads MBean to retrieve the list of deadlocked thread IDs. (The method returns null if no deadlocks exist.)

This PR changes that code to report ERROR instead of DOWN. By reporting DOWN the previous code incorrectly implied that there was a deadlock and the server instance should be considered "unwell." In fact, in that case the health check code does not know whether there is or is not a deadlock because of the error invoking the MBean method and it should report that way.

The PR also adds a test.

Documentation

No impact.

@tjquinno tjquinno self-assigned this Jan 24, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 24, 2025
@tjquinno tjquinno merged commit 7b62e77 into helidon-io:main Jan 27, 2025
58 checks passed
@tjquinno tjquinno deleted the 4.x-fix-deadlock-health-check-jmx-failure branch January 27, 2025 17:19
@tjquinno tjquinno mentioned this pull request Jan 27, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.x Deadlock health check reports DOWN when it cannot access the JMX MBean to find deadlocks
2 participants