EventBus registration fails on connection between cluster nodes
When cluster nodes connect, the one initiation connection (just started) will reject to subscribe to events, nodes which are connecting to it.
#2 Updated by Andrzej Wójcik over 1 year ago
- Status changed from New to In QA
- Assignee changed from Andrzej Wójcik to Wojciech Kapcia
- % Done changed from 0 to 100
2018-01-16 19:02:26.122 [in_0-eventbus] SubscribeModule.processNonClusterSubscription() FINEST: Processing noncluster subscription request from firstname.lastname@example.org
2018-01-16 19:02:26.123 [in_0-eventbus] SubscribeModule.processNonClusterSubscription() FINE: Subscription rejected. Subscriber email@example.com has bad affiliation: none
2018-01-16 19:02:26.134 [pool-27-thread-1] BasicComponent.refreshTrustedJids() FINEST: component cl-comp got trusted jids set as 
2018-01-16 19:02:26.134 [pool-27-thread-1] BasicComponent.nodeConnected() FINE: Node connected: node1.xmpp-test.net
2018-01-16 19:02:26.134 [pool-27-thread-1] EventBusComponent.onNodeConnected() FINE: Cluster node firstname.lastname@example.org added to Affiliation Store
As visible in this log,
onNodeConnected() method of
EventBusComponent is called after packet from remote cluster node is delivered. This is caused by a race condition as
onNodeConnected() method execution is too slow and packets may be delivered using different cluster connections resulting in an error.
EventBusComponent is critical for Tigase XMPP Server and need to properly work in the cluster I've decided to move it in front of the list of components for which
onNodeConnected() is executed.
This fixes this issue and is a solution for #6574 as well.
Log entries with the fix applied:
2018-01-17 14:07:24.027 [pool-27-thread-2] SubscribeModule.clusterNodeConnected() FINER: Node email@example.com is connected. Preparing subscribe request.
2018-01-17 14:07:24.028 [pool-27-thread-2] SubscribeModule.sendSubscribeRequest() FINER: Sending subscribe request (id=node2.xmpp-test.net-1) to node firstname.lastname@example.org
2018-01-17 14:07:24.084 [in_0-eventbus] SubscribeModule.processClusterSubscription() FINEST: Processing cluster subscription request from email@example.com
2018-01-17 14:07:24.084 [in_0-eventbus] SubscribeModule.processClusterSubscription() FINE: Node firstname.lastname@example.org subscribed for events tigase.eventbus.impl.ListenerRemovedEvent
2018-01-17 14:07:24.084 [in_0-eventbus] SubscribeModule.processClusterSubscription() FINE: Node email@example.com subscribed for events tigase.pubsub.modules.ext.presence.LogoffFromNodeEvent