Skip to content

Conversation

@barchetta
Copy link
Member

Backport #9694 to Helidon 4.1.7

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.

…helidon-io#9694)

* Report ERROR instead of DOWN if MBean invocation fails

* Fix confusing comment
@barchetta barchetta added the backport Issues that are merged into a single branch, but missing in either master or previous release label Feb 10, 2025
@barchetta barchetta added this to the 4.1.7 milestone Feb 10, 2025
@barchetta barchetta requested a review from tjquinno February 10, 2025 16:16
@barchetta barchetta self-assigned this Feb 10, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 10, 2025
@barchetta barchetta mentioned this pull request Feb 10, 2025
15 tasks
@barchetta barchetta merged commit 1a13241 into helidon-io:helidon-4.1.x Feb 10, 2025
44 checks passed
@barchetta barchetta deleted the 4.1.7-9694-backport branch February 10, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Issues that are merged into a single branch, but missing in either master or previous release OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants