This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new e6a631d  Close ZK before canceling future with exception (#6228) 
(#6399)
e6a631d is described below

commit e6a631d491948119c07a30339c7daf71002c5c0a
Author: Paweł Łoziński <[email protected]>
AuthorDate: Sat Feb 29 21:53:15 2020 +0100

    Close ZK before canceling future with exception (#6228) (#6399)
    
    Fixes #6228
---
 .../java/org/apache/pulsar/zookeeper/ZookeeperBkClientFactoryImpl.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZookeeperBkClientFactoryImpl.java
 
b/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZookeeperBkClientFactoryImpl.java
index aac96ce..8cd674d 100644
--- 
a/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZookeeperBkClientFactoryImpl.java
+++ 
b/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZookeeperBkClientFactoryImpl.java
@@ -55,6 +55,7 @@ public class ZookeeperBkClientFactoryImpl implements 
ZooKeeperClientFactory {
                         .build();
 
                 if (zk.getState() == States.CONNECTEDREADONLY && sessionType 
!= SessionType.AllowReadOnly) {
+                    zk.close();
                     future.completeExceptionally(new 
IllegalStateException("Cannot use a read-only session"));
                 }
 

Reply via email to