You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the plugin detects that a remote cluster node leaves the cluster, it fires off an event to reflect this (which invokes leftCluster(nodeId)) on all listeners. The plugin then cleans up things. The corresponding code can mostly be found in
There is a race condition here, that is caused by the invocation of the event listeners (in the first line) to be asynchronous. It causes the execution of that invocation to be parallel to the execution of the cleanup. This can cause problems for implementations of the event listener, if they operate on the same data. As the clean-up modifies pretty low-level state (routing table, session manager), the chance of indirect interference is pretty high.
It would probably be good to separate the two, to make sure that there's no interference. I assume (but haven not verified) that the existing order of execution (first event listeners, then cleanup) is OK (although maybe it's worth investigating if that needs reversal). In any case, the first should have had time to finish execution before the second is started. Some kind of callback implementation could be used to achieve this.
The text was updated successfully, but these errors were encountered:
When the plugin detects that a remote cluster node leaves the cluster, it fires off an event to reflect this (which invokes
leftCluster(nodeId)
) on all listeners. The plugin then cleans up things. The corresponding code can mostly be found inopenfire-hazelcast-plugin/src/java/org/jivesoftware/openfire/plugin/util/cache/ClusterListener.java
Lines 715 to 730 in da9b8e6
There is a race condition here, that is caused by the invocation of the event listeners (in the first line) to be asynchronous. It causes the execution of that invocation to be parallel to the execution of the cleanup. This can cause problems for implementations of the event listener, if they operate on the same data. As the clean-up modifies pretty low-level state (routing table, session manager), the chance of indirect interference is pretty high.
It would probably be good to separate the two, to make sure that there's no interference. I assume (but haven not verified) that the existing order of execution (first event listeners, then cleanup) is OK (although maybe it's worth investigating if that needs reversal). In any case, the first should have had time to finish execution before the second is started. Some kind of callback implementation could be used to achieve this.
The text was updated successfully, but these errors were encountered: