zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "maoling (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ZOOKEEPER-3158) firstConnect.countDown() will not be executed where sendThread.primeConnection() has thrown an exception
Date Sat, 29 Sep 2018 03:48:00 GMT
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)

Mime
View raw message