Skip to content

Log JMX RMI connector startup failure at error level#699

Merged
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/jmx-rmi-startup-error-logging
Jul 6, 2026
Merged

Log JMX RMI connector startup failure at error level#699
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/jmx-rmi-startup-error-logging

Conversation

@vharseko

@vharseko vharseko commented Jul 4, 2026

Copy link
Copy Markdown
Member

Problem

When RMIConnectorServer.start() fails, the error is invisible: RmiConnector.initialize() logs the exception only via logger.traceException (trace is off in normal runs and CI) before wrapping it in a RuntimeException, which JmxConnectionHandler.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.setUp polled jmxRmiConnectorNoClientCertificate.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 from start() (fragile hostname resolution / ephemeral-range test ports on macOS runners) was lost.

Change

  • New message ERR_JMX_CONNHANDLER_CANNOT_START_RMI_CONNECTOR in protocol.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" in JmxConnectionHandler.run() finally holds.

No behavioural change beyond logging.

Testing

mvn -pl opendj-server-legacy -P precommit integration-test -Dit.test=JmxPrivilegeTestCase — 33/33 passed.

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.
Comment thread opendj-server-legacy/src/messages/org/opends/messages/protocol.properties Outdated
….properties

Co-authored-by: Maxim Thomas <maxim.thomas@gmail.com>
@vharseko vharseko merged commit d410901 into OpenIdentityPlatform:master Jul 6, 2026
9 checks passed
@vharseko vharseko deleted the features/jmx-rmi-startup-error-logging branch July 6, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants