Skip to content

allow_session_lost ignored for DataWatch #157

@jimfulton

Description

@jimfulton

I have 2 connections against 2 tunnels

>>> import kazoo.client
>>> c = kazoo.client.KazooClient('localhost:2182')
>>> c2 = kazoo.client.KazooClient('localhost:2183')
>>> @c.add_listener
... def _(state):
...     print state
... 
>>> c.start()
CONNECTED
>>> c2.start()
>>> @c.DataWatch('/test', allow_session_lost=True)
... def _(data, *a):
...     print True, data
... 
True q
>>> @c.DataWatch('/test', allow_session_lost=False)
... def _(data, *a):
...     print False, data
... 
False q

I shut down the first tunnel.

SUSPENDED

I wait a while and restart it:

LOST
CONNECTED

>>> _ = c2.set('test', 'a')

False a
True a

Both of the watches are re-established. Only one should be, although I don't know which. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions