Skip to content

Commit 31e7249

Browse files
author
Stephane Landelle
committed
When debug is enabled, Netty ConnectListener erroneously consumes a retry token, close AsyncHttpClient#436
1 parent 16550ec commit 31e7249

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyConnectListener.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.slf4j.LoggerFactory;
3434

3535
import javax.net.ssl.HostnameVerifier;
36+
3637
import java.io.IOException;
3738
import java.net.ConnectException;
3839
import java.net.InetSocketAddress;
@@ -85,8 +86,9 @@ public final void operationComplete(ChannelFuture f) throws Exception {
8586
} else {
8687
Throwable cause = f.getCause();
8788

88-
logger.debug("Trying to recover a dead cached channel {} with a retry value of {} ", f.getChannel(), future.canRetry());
89-
if (future.canRetry() && cause != null && (NettyAsyncHttpProvider.abortOnDisconnectException(cause)
89+
boolean canRetry = future.canRetry();
90+
logger.debug("Trying to recover a dead cached channel {} with a retry value of {} ", f.getChannel(), canRetry);
91+
if (canRetry && cause != null && (NettyAsyncHttpProvider.abortOnDisconnectException(cause)
9092
|| cause instanceof ClosedChannelException
9193
|| future.getState() != NettyResponseFuture.STATE.NEW)) {
9294

0 commit comments

Comments
 (0)