slyphon/zookeeper — pull request #1 by akramer (2012-03-27 05:12:41+00:00)
Title: Fixing a relatively nasty bug...

Where upon connecting and reconnected events, all watches would be
cleared. The C client resets watches when it reconnects, and so these
should not be removed from our list of events.
I believe the only event that should remove watches (besides a
legitimate trigger) is a SESSION_EXPIRED event.

Amusingly, the same bug existed in the python libraries, only it would
crash the process upon reconnection:
https://issues.apache.org/jira/browse/ZOOKEEPER-888

That might be arguably better behavior, actually, as it would prevent
processes from soldiering on expecting that their watches are still
valid.