@@ -765,8 +765,6 @@ private <T> Future<T> doConnect(final Request request, final AsyncHandler<T> asy
765
765
return f ;
766
766
}
767
767
768
- log .debug ("\n \n Non cached Request {}\n " , request );
769
-
770
768
if (!connectionsPool .canCacheConnection () ||
771
769
(config .getMaxTotalConnections () > -1 && (maxConnections .get () + 1 ) > config .getMaxTotalConnections ())) {
772
770
throw new IOException (String .format ("Too many connections %s" , config .getMaxTotalConnections ()));
@@ -825,6 +823,8 @@ private <T> Future<T> doConnect(final Request request, final AsyncHandler<T> asy
825
823
channelFuture .addListener (c );
826
824
}
827
825
826
+ log .debug ("\n \n Non cached Request {}\n using Channel {}" , request , channelFuture .getChannel ());
827
+
828
828
if (!c .future ().isCancelled () || !c .future ().isDone ()) {
829
829
openChannels .add (channelFuture .getChannel ());
830
830
c .future ().attachChannel (channelFuture .getChannel (), false );
@@ -1252,7 +1252,7 @@ private void abort(NettyResponseFuture<?> future, Throwable t) {
1252
1252
openChannels .remove (future .channel ());
1253
1253
}
1254
1254
1255
- log .debug ("aborting Future {}" , future );
1255
+ log .debug ("aborting Future {}\n " , future );
1256
1256
log .debug (t .getMessage (), t );
1257
1257
1258
1258
future .abort (t );
@@ -1293,7 +1293,7 @@ public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws
1293
1293
exception = ex ;
1294
1294
}
1295
1295
1296
- log .debug ("Channel Closed: {}" , e .getChannel ());
1296
+ log .debug ("Channel Closed: {}\n with attachment {} \n " , e .getChannel (), ctx . getAttachment ());
1297
1297
1298
1298
if (ctx .getAttachment () instanceof AsyncCallable ) {
1299
1299
AsyncCallable ac = (AsyncCallable ) ctx .getAttachment ();
@@ -1334,15 +1334,13 @@ protected boolean remotelyClosed(Channel channel, NettyResponseFuture<?> future)
1334
1334
1335
1335
connectionsPool .removeAll (channel );
1336
1336
1337
- if (future == null && channel .getPipeline ().getContext (NettyAsyncHttpProvider .class ).getAttachment () != null
1338
- && NettyResponseFuture .class .isAssignableFrom (
1339
- channel .getPipeline ().getContext (NettyAsyncHttpProvider .class ).getAttachment ().getClass ())) {
1337
+ if (future == null ) {
1340
1338
future = (NettyResponseFuture <?>)
1341
1339
channel .getPipeline ().getContext (NettyAsyncHttpProvider .class ).getAttachment ();
1342
1340
}
1343
1341
1344
1342
if (future == null || future .cannotBeReplay ()) {
1345
- log .debug ("Unable to replay request {} associated with future" , future == null ? "" : future .getNettyRequest (), future );
1343
+ log .debug ("Unable to replay request {}\n associated with future {} " , future == null ? "null " : future .getNettyRequest (), future );
1346
1344
return false ;
1347
1345
}
1348
1346
@@ -1453,7 +1451,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
1453
1451
}
1454
1452
1455
1453
if (abortOnReadCloseException (cause ) || abortOnWriteCloseException (cause )) {
1456
- log .debug ("Trying to recover from dead Channel: {}" , channel );
1454
+ log .debug ("Trying to recover request {} \n from dead Channel: {}\n " , channel );
1457
1455
if (remotelyClosed (channel , future )) {
1458
1456
return ;
1459
1457
}
@@ -1724,7 +1722,7 @@ public synchronized void run() {
1724
1722
}
1725
1723
1726
1724
if (this .nettyResponseFuture != null && this .nettyResponseFuture .hasExpired ()) {
1727
- log .debug ("Request Timeout expired for {}" , this .nettyResponseFuture );
1725
+ log .debug ("Request Timeout expired for {}\n " , this .nettyResponseFuture );
1728
1726
1729
1727
int requestTimeout = config .getRequestTimeoutInMs ();
1730
1728
PerRequestConfig p = this .nettyResponseFuture .getRequest ().getPerRequestConfig ();
0 commit comments