We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use kazoo.KazooRetry try to reconect, but current ephemeral node not recovery. I want the ephemeral node automatic recovery. so what should do?
kazoo.KazooRetry
code:
retry = KazooRetry(max_tries=-1, delay=1) zk_client = KazooClient(hosts=zk_hosts, connection_retry=retry) def listener(state): if state == KazooState.CONNECTED: print("state: ", state) return False zk_client.add_listener(listener) zk_client.start() node_path = "/test_env/test_node" zk_client.create(node_path, value=b"test", ephemeral=True) while True: try: node_exist = True if zk_client.connected and zk_client.exists(node_path) else False except kazoo.exceptions.ConnectionLoss: node_exist = False print("connected:", zk_client.connected, "node_exists:", node_exist) time.sleep(5)
output:
state: CONNECTED connected: True node_exists: True connected: True node_exists: True Connection dropped: outstanding heartbeat ping not received Transition to CONNECTING connected: False node_exists: False Connection dropped: socket connection error: Can't assign requested address Connection dropped: socket connection error: Can't assign requested address Connection dropped: socket connection error: Can't assign requested address connected: False node_exists: False Connection dropped: socket connection error: Can't assign requested address Connection dropped: socket connection error: Can't assign requested address Connection dropped: socket connection error: Can't assign requested address connected: False node_exists: False connected: False node_exists: False Session has expired state: CONNECTED connected: True node_exists: False connected: True node_exists: False
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use
kazoo.KazooRetry
try to reconect, but current ephemeral node not recovery.I want the ephemeral node automatic recovery. so what should do?
code:
output:
The text was updated successfully, but these errors were encountered: