@@ -276,7 +276,7 @@ private Channel lookupInCache(URI uri) {
276
276
final Channel channel = connectionsPool .poll (AsyncHttpProviderUtils .getBaseUrl (uri ));
277
277
278
278
if (channel != null ) {
279
- log .debug ("Using cached Channel {} for uri {}" , channel , uri );
279
+ log .debug ("Using cached Channel {}\n for uri {}\n " , channel , uri );
280
280
281
281
try {
282
282
// Always make sure the channel who got cached support the proper protocol. It could
@@ -748,7 +748,7 @@ private <T> Future<T> doConnect(final Request request, final AsyncHandler<T> asy
748
748
f .setState (NettyResponseFuture .STATE .POOLED );
749
749
f .attachChannel (channel , false );
750
750
751
- log .debug ("\n \n Cached Request {}\n " , channel );
751
+ log .debug ("\n Using cached Channel {} \n for request {}\n " , channel , request );
752
752
channel .getPipeline ().getContext (NettyAsyncHttpProvider .class ).setAttachment (f );
753
753
754
754
try {
@@ -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 with channel {}\n " , request , channel );
827
+
828
828
if (!c .future ().isCancelled () || !c .future ().isDone ()) {
829
829
openChannels .add (channelFuture .getChannel ());
830
830
c .future ().attachChannel (channelFuture .getChannel (), false );
@@ -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: {} with attachment {} " , e .getChannel (), ctx . getAttachment ());
1297
1297
1298
1298
if (ctx .getAttachment () instanceof AsyncCallable ) {
1299
1299
AsyncCallable ac = (AsyncCallable ) ctx .getAttachment ();
@@ -1342,21 +1342,21 @@ protected boolean remotelyClosed(Channel channel, NettyResponseFuture<?> future)
1342
1342
}
1343
1343
1344
1344
if (future == null || future .cannotBeReplay ()) {
1345
- log .debug ("Unable to replay request {} associated with future" , future == null ? "" : future .getNettyRequest (), future );
1345
+ log .debug ("Unable to replay request {}\n associated with future {} \n " , future == null ? "null " : future .getNettyRequest (), future );
1346
1346
return false ;
1347
1347
}
1348
1348
1349
1349
future .setState (NettyResponseFuture .STATE .RECONNECTED );
1350
1350
1351
- log .debug ("Trying to recover request {}" , future .getNettyRequest ());
1351
+ log .debug ("Trying to recover request {}\n " , future .getNettyRequest ());
1352
1352
1353
1353
try {
1354
1354
nextRequest (future .getRequest (), future );
1355
1355
return true ;
1356
1356
} catch (IOException iox ) {
1357
1357
future .setState (NettyResponseFuture .STATE .CLOSED );
1358
1358
future .abort (iox );
1359
- log .error ("Remotely Closed" , iox );
1359
+ log .error ("Remotely Closed, unable to recover " , iox );
1360
1360
}
1361
1361
return false ;
1362
1362
}
@@ -1453,7 +1453,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
1453
1453
}
1454
1454
1455
1455
if (abortOnReadCloseException (cause ) || abortOnWriteCloseException (cause )) {
1456
- log .debug ("Trying to recover from dead Channel: {}" , channel );
1456
+ log .debug ("Trying to recover from dead Channel: {}\n request {} " , channel , future . getNettyRequest () );
1457
1457
if (remotelyClosed (channel , future )) {
1458
1458
return ;
1459
1459
}
@@ -1724,7 +1724,7 @@ public synchronized void run() {
1724
1724
}
1725
1725
1726
1726
if (this .nettyResponseFuture != null && this .nettyResponseFuture .hasExpired ()) {
1727
- log .debug ("Request Timeout expired for {}" , this .nettyResponseFuture );
1727
+ log .debug ("Request Timeout expired for {}\n " , this .nettyResponseFuture );
1728
1728
1729
1729
int requestTimeout = config .getRequestTimeoutInMs ();
1730
1730
PerRequestConfig p = this .nettyResponseFuture .getRequest ().getPerRequestConfig ();
0 commit comments