Skip to content

Fix unavailable monitoring attributes over JMX - #558

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:jmx
Oct 6, 2025
Merged

vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:jmx

Conversation

@vharseko

Copy link
Copy Markdown
Member

When the ReplicationBroker switched to a different RS, the replication monitor MBean could remain registered under the old instance. As a result, JMX clients (e.g. JConsole) displayed "Unavailable" for Directory Server replication monitoring attributes.

Fixes:

  • ReplicationBroker#setConnectedRS(): Deregister the ReplicationMonitor before its instance name1 changes, otherwise the deregistration will not be successful.
  • DirectoryServer#deregisterMonitorProvider(): when an MBean has no monitor providers, remove it from the local registry and unregister it from the MBeanServer to avoid stale MBeans.

(cherry picked from commit efc93490e3d16cc2426849deb231cbe3bf4f6440)

Footnotes

  1. https://github.com/WrenSecurity/wrends/blob/09cf0ade4fd10e5e1e7aa7b220e0b7a616a89cfc/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationMonitor.java#L59 ↩

When the ReplicationBroker switched to a different RS, the replication
monitor MBean could remain registered under the old instance.
As a result, JMX clients (e.g. JConsole) displayed "Unavailable" for
Directory Server replication monitoring attributes.

Fixes:

- ReplicationBroker#setConnectedRS(): Deregister the ReplicationMonitor
  before its instance name[^getMonitorInstanceName] changes, otherwise
  the deregistration will not be successful.
- DirectoryServer#deregisterMonitorProvider(): when an MBean has no
  monitor providers, remove it from the local registry and unregister it
  from the MBeanServer to avoid stale MBeans.

[^getMonitorInstanceName]: https://github.com/WrenSecurity/wrends/blob/09cf0ade4fd10e5e1e7aa7b220e0b7a616a89cfc/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationMonitor.java#L59

(cherry picked from commit efc93490e3d16cc2426849deb231cbe3bf4f6440)
@vharseko
vharseko merged commit d7e652c into OpenIdentityPlatform:master Oct 6, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants