DiscoveryServiceImpl, in bindTopologyEventListener, does not correctly synchronize sending the INIT event - the INIT event is sent outside of synchronized(lock) - opening up the possibility of a race condition where bindTopologyEventListener happens while a CHANGING or CHANGED event is just being sent (which would hold the lock object), and an INIT could be sent after CHANGING and/or CHANGED.
- even though the API guarantees that the order of events is always: INIT->CHANGING->CHANGED
- it can happen, due to this bug, that you can first get CHANGING and/or CHANGED and then afterwards an INIT.
- nevertheless, INIT is never called twice
To fix this, bindTopologyEventListener needs to send the INIT event in the synchronized(lock) block