zhaizhibo commented on code in PR #25237:
URL: https://github.com/apache/pulsar/pull/25237#discussion_r2791305937


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/PulsarZooKeeperClient.java:
##########
@@ -151,6 +159,15 @@ public String toString() {
 
     };
 
+    private ZooKeeper getZkHandle() {
+        lock.readLock().lock();

Review Comment:
   The primary fix that actually works is in modification 1, which sets 
currentStatus before calling sessionListener.accept. Adding a read-write lock 
merely reduces the probability of operations using the old ZooKeeper client. 
Once a new client needs to be created, incoming operations must wait until the 
new client creation is complete.



-- 
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]

Reply via email to