zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ZOOKEEPER-3158) firstConnect.countDown() will not be executed where sendThread.primeConnection() has thrown an exception
Date Wed, 10 Oct 2018 09:31:00 GMT

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-3158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

ASF GitHub Bot updated ZOOKEEPER-3158:
--------------------------------------
    Labels: pull-request-available  (was: )

> 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
>            Priority: Trivial
>              Labels: pull-request-available
>
> look at the source code in the ClientCnxnSocketNetty.connect(InetSocketAddress):
> {code:java}
> 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();
>                 }
>             }
>  });
> {code}
> 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