Skip to content

[KYUUBI-7556] Fix engine deregistration watcher not rearmed after ZK reconnect - #7703

Closed
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/zk-reconnect-deregistration-watcher-7556
Closed

[KYUUBI-7556] Fix engine deregistration watcher not rearmed after ZK reconnect#7703
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/zk-reconnect-deregistration-watcher-7556

Conversation

@zhang-arvin

Copy link
Copy Markdown

What changes were proposed in this pull request?

Fix the issue where Kyuubi engine's deregistration watcher is not re-registered after ZooKeeper session expires and reconnects.

When a ZooKeeper session expires, all watches are cleared because they are tied to the session. The PersistentNode handles recreating the ephemeral node when the connection is re-established, but the explicit DeRegisterWatcher set via watchNode() was never re-armed. This means if the engine later crashes, its ZK node won't be properly cleaned up because the watcher is gone.

Why are the changes needed?

Without this fix, after a ZK session expiry and reconnect, the engine's deregistration watcher is lost. If the engine subsequently crashes, the ZK ephemeral node won't be cleaned up, causing stale entries in the ZooKeeper namespace.

How was this patch tested?

  • Manual code review of the connection state handling logic
  • Existing ZK discovery client tests in ZookeeperDiscoveryClientSuite

Was this patch authored or co-authored using generative AI tooling?

No

Closes #7556

@github-actions

Copy link
Copy Markdown

Hello @zhang-arvin,
Thanks for finding the time to submit the Pull request, the Kyuubi community thanks you!
We really appreciate the community's efforts to improve Apache Kyuubi.
If you are new to Apache Kyuubi for code changes, please take some time to read our contributing guide.

@wangzhigang1999

Copy link
Copy Markdown
Contributor

This issue is already being addressed by #7558, which was opened by the issue reporter and is under review.

Please check for existing PRs before claiming an issue or opening a competing patch. If you have suggestions, please contribute them to the existing PR instead.

Closing this as a duplicate of #7558.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Kyuubi Fails to Rearm the Engine Deregistration Watcher After ZooKeeper Reconnect

2 participants