zhang-arvin opened a new pull request, #7703: URL: https://github.com/apache/kyuubi/pull/7703
### _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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
