powered by Jive Software

[Hazelcast-Plugin] marked as senior event is not triggered (solved)

On startup the ClusteredCacheFactory calls the constructor of the ClusterListener, which calls the CacheFactory.isSeniorClusterMember(). This method checks if the clusterListerner object is null. This is always the case because the object is not set at this moment.

Pull request for a fix: https://github.com/igniterealtime/Openfire/pull/1151

Are you actually seeing this as a problem? Is it every time or just some of the time?

I only ask because we probably have a dozen clusters running and have yet to see it as an issue!

Greg

Hi,

you can reproduce this every time.

Simply implement and register a ClusterEventListener and log the method invocations.
Start a single node. joinedCluster() is called every time but markedAsSeniorClusterMember() is never called.

The JavaDoc of ClusterEventListener.joinedCluster() says:

"Notification event indicating that this JVM is now part of a cluster. At this point the
{@link org.jivesoftware.openfire.XMPPServer#getNodeID()} holds the new nodeID value.

When joining the cluster as the senior cluster member the {@link #markedAsSeniorClusterMember()}
event will be sent right after this event."

So i think it is a Bug.

All implementations of markedAsSeniorClusterMember() in the openfire repository are “no-ops” like:

@Override
public void markedAsSeniorClusterMember() {
// Do nothing
}

I think thats why it was not noticed.

Thanks for supplying the patch! I’ve now merged in the fix, but it won’t be available until after the release of Openfire 4.3 unfortunately.

Hi,

you are welcome and 4.3 is ok.

Best Regards

Christian