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)

Reply via email to