Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZOOKEEPER-3652: Synchronize ClientCnxn outgoing queue flush on a stab…
…le internal value When packets are added to ClientCnxn's outgoing packet queue we ensure there's no conflict with an ongoing flush of that queue because of connection loss. Synchronization used to be on the state field's value. This value is both not stable (its value changes over time), possibly causing improper synchronization, and global, which can cause contention in applications that run several ZooKeeper clients. We now synchronize on outgoingQueue which is both local to a ClientCnxn's instance and stable. Author: Sylvain Wallez <sylvain@bluxte.net> Reviewers: maoling <maoling@apache.org>, Mohammad Arshad <arshad@apache.org> Closes #1257 from swallez/ZOOKEEPER-3652 and squashes the following commits: 82e2cad [Sylvain Wallez] Instruct SpotBugs that we know what we're doing when synchronizing on outgoingQueue b0bc03d [Sylvain Wallez] ZOOKEEPER-3652: Synchronize ClientCnxn outgoing queue flush on a stable internal value (cherry picked from commit 91e0520) Signed-off-by: Mohammad Arshad <arshad@apache.org>
- Loading branch information