Elffuss BraidHub

kikocis/java-driver public

Avoid blocking on failed connections at shutdown.

This is a workaround for Netty bug 3464, which will be fixed in
4.0.27.Final.
Changeset7327bc67fe0628cbce462dfa2038bcac32c196e9d87c7003870856e94d282a3f
Authorolim7t <omichallat+github@gmail.com> · 2015-03-27 18:42 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2015-03-30 15:59 +02:00
Parents5e4320ed3019

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/Connection.java +1 −1
@@ -115,12 +115,12 @@
115115 try {
116116 // Wait until the connection attempt succeeds or fails.
117117 this.channel = future.awaitUninterruptibly().channel();
118- this.factory.allChannels.add(this.channel);
119118 if (!future.isSuccess()) {
120119 if (logger.isDebugEnabled())
121120 logger.debug(String.format("%s Error connecting to %s%s", this, address, extractMessage(future.cause())));
122121 throw defunct(new TransportException(address, "Cannot connect", future.cause()));
123122 }
123+ this.factory.allChannels.add(this.channel);
124124 channel.closeFuture().addListener(new ChannelCloseListener());
125125 } finally {
126126 writer.decrementAndGet();