If I create a DataWatch with allow_missing_node=True on a nonexistent node, then create and delete the node once, it works fine; but if I create the node yet again, the watch is not triggered.
from kazoo.client import KazooClient
from kazoo.recipe.watchers import DataWatch
client = KazooClient("localhost:2181")
path = '/foo'
data = 'DATA'
def dwatch(data, stat):
print data, stat
# The watch sees these...
# then doesn't see these
DATA2 ZnodeStat(czxid=193, mzxid=193, ctime=1362687003891, mtime=1362687003891, version=0, cversion=0, aversion=0, ephemeralOwner=0, dataLength=5, numChildren=0, pzxid=193)
Found the problem, upon node deletion it wasn't accurately tracking that there was no longer prior data, so it would fail to properly handle the creation and re-register.
Fixes Issue #58.
Datawatcher properly re-registers after multiple delete/create.
We also enforce some basic retry settings to avoid endless waits in testing.