Details
-
Bug
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
None
-
None
Description
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.