Andrew Kyle Purtell created ZOOKEEPER-5120:
----------------------------------------------

             Summary: (C client) Forced closes leaks request queues and 
corrupts session state
                 Key: ZOOKEEPER-5120
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-5120
             Project: ZooKeeper
          Issue Type: Bug
          Components: c client
            Reporter: Andrew Kyle Purtell
            Assignee: Andrew Kyle Purtell


Calling threads close the client socket directly during server reconfigurations 
or failed async writes, bypassing proper cleanup and producing invalid internal 
states. This triggers several race conditions: healthy connections are dropped 
when the wake-up pipe backs up, pending requests are routed to new servers 
prematurely, watchers are exposed to inconsistent states, and authentication 
failures are masked.

The fix is to manage the lifecycle strictly in the I/O driver. Calling threads 
no longer close sockets or mutate client state themselves. Instead they set a 
disconnect request flag and signal the I/O thread. The driver handles the 
teardown deterministically, notifying watchers of a reconnecting state, cleanly 
failing in-flight requests with connection loss, and hardening the wake up path 
against pipe congestion and signal interruptions.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to