Log JMX RMI connector startup failure at error level#699
Merged
vharseko merged 2 commits intoJul 6, 2026
Merged
Conversation
RmiConnector.initialize() only traced the exception from RMIConnectorServer.start() before wrapping it in a RuntimeException that JmxConnectionHandler.run() silently swallows. When the connector failed to start (e.g. flaky JmxPrivilegeTestCase.setUp timeouts on macOS CI), the server log contained no hint of the cause: the handler thread just died leaving a non-null but inactive connector. Report the failure via a new ERR_JMX_CONNHANDLER_CANNOT_START_RMI_CONNECTOR message with the handler entry DN, listen port and exception message.
maximthomas
approved these changes
Jul 6, 2026
maximthomas
reviewed
Jul 6, 2026
….properties Co-authored-by: Maxim Thomas <maxim.thomas@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
RMIConnectorServer.start()fails, the error is invisible:RmiConnector.initialize()logs the exception only vialogger.traceException(trace is off in normal runs and CI) before wrapping it in aRuntimeException, whichJmxConnectionHandler.run()then silently swallows. The handler thread dies leaving a non-null but inactive connector and not a single line in the server logs.This is exactly what made the
build-maven (25, macos-latest)failure in run 28701491443 (PR #688, unrelated diff) undiagnosable:JmxPrivilegeTestCase.setUppolledjmxRmiConnectorNoClientCertificate.isActive()for 20 s and timed out, the thread dump showed the RMI registry accept thread alive but no JMX Connection Handler thread, and the log contained no error at all. The actual exception fromstart()(fragile hostname resolution / ephemeral-range test ports on macOS runners) was lost.Change
ERR_JMX_CONNHANDLER_CANNOT_START_RMI_CONNECTORinprotocol.properties.RmiConnector.initialize()now logs it at error level (handler config entry DN, listen port, exception message) before rethrowing, so the comment "Already caught and logged" inJmxConnectionHandler.run()finally holds.No behavioural change beyond logging.
Testing
mvn -pl opendj-server-legacy -P precommit integration-test -Dit.test=JmxPrivilegeTestCase— 33/33 passed.