baiyiwen created ZOOKEEPER-4947: ----------------------------------- Summary: When ZooKeeper client enters AuthFailed state (e.g., due to SASL authentication failure), calling `close()` method does not terminate internal SendThread and EventThread. Key: ZOOKEEPER-4947 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4947 Project: ZooKeeper Issue Type: Bug Components: java client Affects Versions: 3.9.0, 3.7.1, 3.8.0, 3.6.1, 3.4.8 Reporter: baiyiwen
Problem When ZooKeeper client enters AuthFailed state (e.g., due to SASL authentication failure), calling `close()` method does not terminate internal SendThread and EventThread. Reproduction Steps 1. Configure SASL authentication with invalid credentials 2. Connect to ZooKeeper server 3. Watch receives `KeeperState.AuthFailed` event 4. Call `zookeeper.close()` 5. Observe SendThread/EventThread still running via thread dump Expected Behavior All client resources including background threads should be released. Proposed Fix Remove state check in close method: public synchronized void close() throws InterruptedException { if (cnxn != null) { cnxn.close(); } } -- This message was sent by Atlassian Jira (v8.20.10#820010)