kazoo
kazoo copied to clipboard
stuck when create ephemeral node in CONNECTED state event
Hi ,guys, here is my code
def watch_state(state):
"""
Listen zookeeper connection events
"""
if state == KazooState.LOST:
self.logger.warn('connection to zookeeper lost, session expired')
elif state == KazooState.SUSPENDED:
self.logger.warn('connection to zookeeper suspended')
elif state == KazooState.CONNECTED:
self.logger.warn('connection to zookeeper restored')
// stuck when call create node
self._create_node()
It's no problem when I use this code in curator, but it is stuck in kazoo, where should I recreate the ephemeral node when kazoo reconnect to zookeeper after session expired ?
Hello Endlesscode, I'm facing exact same issue with my code; when I turn off all the ZK observer nodes, kazoo goes from SUSPENDED > LOST state and when I bring ZK back, kazoo goes to CONNECTED and tries to publish the ephemeral node but doesn't get any response from ZK. Have you found a solution or a workaround? The only workaround that works for me is service restart which seems to resolve the issue. Thanks for your help!
I run create_node
in another thread :)
@Endlesscode ,Is their any better way to solve the problem? Thanks
I'm facing the same problem too ,does anyone has any better solution?
I met similar problem when call any function of create_instance/get_children/get when state == KazooState.CONNECTED
it just stuck there and nothing error or return