e5540b630b102c4c98ddbd156955c94da870860e
The current implementation leverages threads and runs the hooks asynchronously, which is a problem because we can't guarantee the order of member join/leave. For example if the following happen: coord.watch_join_group(x) # takes hours to complete coord.watch_leave_group(x) # is very fast coord2.join_group(x) coord.run_watchers() It's possible that the callback added in `watch_join_group()' that are put in the execution queue will be put _after_ the callbacks put by `watch_leave_group()' and after the watchers are run. That means that when `run_watchers()' is called, a leave event will be emitted but no previous join event will be emitted. More, the join event will be emitted later, putting the system in a wrong state. This patches drops the async callback push back in queue to run the common code that is synchronous and serialized and do not have this bug. Change-Id: Ib289035084cb1a6c4d7e73d4ac1a023591298a8e
Tooz
The Tooz project aims at centralizing the most common distributed primitives like group membership protocol, lock service and leader election by providing a coordination API helping developers to build distributed applications.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/tooz
- Source: http://git.openstack.org/cgit/openstack/tooz
- Bugs: http://bugs.launchpad.net/python-tooz/
Join us
Description