vert-x3 / vertx-ignite

Apache License 2.0
35 stars 28 forks source link

Prevent race during node listener registration #116

Closed DemonicTutor closed 3 years ago

DemonicTutor commented 3 years ago

Motivation:

I noticed the NodeListener from HAManagerImpl wasnt set on one environment. setting needs to be synchronized on the monitor which is used in join/leave.

Conformance:

Your commits should be signed and you should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines

DemonicTutor commented 3 years ago

maybe not the fanciest solution but definitely easy to understand

zyclonite commented 3 years ago

@DemonicTutor as long as you are using only get and set of the atomic reference, would just switching to a volatile variable do the same trick?