You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "maoling (JIRA)" <ji...@apache.org> on 2018/09/29 03:48:00 UTC

[jira] [Created] (ZOOKEEPER-3158) firstConnect.countDown() will not be executed where sendThread.primeConnection() has thrown an exception

maoling created ZOOKEEPER-3158:
----------------------------------

             Summary: firstConnect.countDown() will not be executed where sendThread.primeConnection() has thrown an exception
                 Key: ZOOKEEPER-3158
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3158
             Project: ZooKeeper
          Issue Type: Bug
          Components: server
            Reporter: maoling


look at the source code in the ClientCnxnSocketNetty.connect(InetSocketAddress):
*public void operationComplete(ChannelFuture channelFuture) throws Exception {
            // this lock guarantees that channel won't be assgined after cleanup().
            connectLock.lock();
                try {
                    //----------------------
                    sendThread.primeConnection();
                    //-----------------------
                    firstConnect.countDown();
                    LOG.info("channel is connected: {}", channelFuture.getChannel());
                } finally {
                    connectLock.unlock();
                }
            }
 });*
firstConnect.countDown() will not be executed where sendThread.primeConnection() has thrown an exception,it should be put into finally code block. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)