Go to file
Julien Danjou e5540b630b zookeeper: switch to standard group membership watching
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
2016-12-07 23:40:35 +01:00
2016-12-07 23:40:35 +01:00
2016-12-07 23:40:35 +01:00
2016-11-14 21:38:00 +01:00
2016-09-22 10:20:50 +02:00
2016-11-18 16:44:36 +08:00
2013-12-19 12:18:35 +01:00
2016-08-26 12:11:47 +02:00
2016-11-28 10:05:45 +07:00
2015-09-17 12:17:45 +00:00
2016-11-18 08:27:46 +00:00

Tooz

Latest Version

Downloads

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.

Join us

Description
RETIRED, further work has moved to Debian project infrastructure
Readme 923 KiB