Projects tigase _server tigase-pubsub Issues #108
Missing notification for published events (#108)
Closed
Bartosz Małkowski opened 4 years ago

One client (on one cluster node) publish item in PubSub node. Publisher receives message stanza with notification. Other subscribers (one different cluster nodes) doesn't receives messages. Subscribers can retrieve items, check subscription list, etc. When client subscribes to node it receives notification with latest published item, but when next item is published then notification is not coming.

Andrzej Wójcik (Tigase) commented 4 years ago

It looks like the issue is caused by cluster node not sending notifications about newly published items to other cluster nodes and other clients, those not receiving notifications, were connected to a different cluster node than publisher.

The issue is in version 5.0.0 of PubSub in clustered strategy and is caused by threading issue (notifications should be "registered" on the same node as item is published, while it is done be EventBus which uses different thread).

Andrzej Wójcik (Tigase) commented 4 years ago

I've separated notification broadcast mechanism to separate class and in ACS-PubSub I've extended this new class to properly handle clustering.

The cause of the issue was the fact that ClusteredNodeStrategy uses ThreadLocal queues to collect all events which need to be forwarded to other cluster nodes as a result of a single PubSub request sent to PubSub component. Thanks to that, there is less traffic between cluster nodes.

However, because we are using ThreadLocal there is a requirement to generate and add all those events from a single thread - the same thread which is processing request sent to the PubSub component, but EventBus has it's own thread pool which are used for calling event handlers and a result, clustering mechanism was not working as expected (ThreadLocal queue for EventBus threads may grow and will never be flushed!).

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0
Spent time
5h 15m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-pubsub#108
Please wait...
Page is in error, reload to recover