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