File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
main/java/org/asynchttpclient/providers/netty
test/java/org/asynchttpclient/providers/netty Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 3434import io .netty .handler .codec .http .HttpHeaders ;
3535import io .netty .handler .codec .http .HttpResponse ;
3636
37+ import java .net .SocketAddress ;
3738import java .net .URI ;
3839import java .util .concurrent .CancellationException ;
3940import java .util .concurrent .CountDownLatch ;
@@ -468,6 +469,10 @@ public boolean canRetry() {
468469 return true ;
469470 }
470471
472+ public SocketAddress getChannelRemoteAddress () {
473+ return channel () != null ? channel ().remoteAddress (): null ;
474+ }
475+
471476 public void setRequest (Request request ) {
472477 this .request = request ;
473478 }
Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ public void run(Timeout timeout) throws Exception {
4545 }
4646
4747 if (!nettyResponseFuture .isDone () && !nettyResponseFuture .isCancelled ()) {
48- expire ("Request timeout of " + nettyResponseFuture .getRequestTimeoutInMs () + " ms" ,
49- millisTime () - nettyResponseFuture .getStart ());
48+ long age = millisTime () - nettyResponseFuture .getStart ();
49+ expire ("Request timed out to " + nettyResponseFuture .getChannelRemoteAddress () + " of "
50+ + nettyResponseFuture .getRequestTimeoutInMs () + " ms after " + age + " ms" , age );
5051 nettyResponseFuture .setRequestTimeoutReached ();
5152 }
5253 }
Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ public class NettyPerRequestTimeoutTest extends PerRequestTimeoutTest {
2222
2323 @ Override
2424 protected void checkTimeoutMessage (String message ) {
25- assertTrue (message .equals ("Request timeout of 100 ms" ));
25+ assertTrue (message .startsWith ("Request timed out" ), "error message indicates reason of error" );
26+ assertTrue (message .contains ("127.0.0.1" ), "error message contains remote ip address" );
27+ assertTrue (message .contains ("of 100 ms" ), "error message contains timeout configuration value" );
2628 }
2729
2830 @ Override
You can’t perform that action at this time.
0 commit comments