Skip to content

Commit 6972985

Browse files
author
Stephane Landelle
committed
Make timeout exception messages more constant
1 parent 9212ce9 commit 6972985

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/main/java/com/ning/http/client/providers/netty/timeout/IdleConnectionTimeoutTimerTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void run(Timeout timeout) throws Exception {
5050
if (durationBeforeCurrentIdleConnectionTimeout <= 0L) {
5151
// idleConnectionTimeout reached
5252
long durationSinceLastTouch = now - nettyResponseFuture.getLastTouch();
53-
expire("Connection reached idle timeout of " + idleConnectionTimeout + " ms after " + durationSinceLastTouch + " ms");
53+
expire("Idle connection timeout of " + idleConnectionTimeout + " ms", durationSinceLastTouch);
5454
nettyResponseFuture.setIdleConnectionTimeoutReached();
5555

5656
} else if (currentIdleConnectionTimeoutInstant < requestTimeoutInstant) {

src/main/java/com/ning/http/client/providers/netty/timeout/RequestTimeoutTimerTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void run(Timeout timeout) throws Exception {
3838
}
3939

4040
if (!nettyResponseFuture.isDone() && !nettyResponseFuture.isCancelled()) {
41-
expire("Request reached timeout of " + nettyResponseFuture.getRequestTimeoutInMs() + " ms after " + (millisTime() - nettyResponseFuture.getStart()) + " ms");
41+
expire("Request timeout of " + nettyResponseFuture.getRequestTimeoutInMs() + " ms", millisTime() - nettyResponseFuture.getStart());
4242
nettyResponseFuture.setRequestTimeoutReached();
4343
}
4444
}

src/main/java/com/ning/http/client/providers/netty/timeout/TimeoutTimerTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public TimeoutTimerTask(NettyResponseFuture<?> nettyResponseFuture, NettyAsyncHt
3838
this.timeoutsHolder = timeoutsHolder;
3939
}
4040

41-
protected void expire(String message) {
42-
LOGGER.debug("{} for {}", message, nettyResponseFuture);
41+
protected void expire(String message, long time) {
42+
LOGGER.debug("{} for {} after {} ms", message, nettyResponseFuture, time);
4343
provider.abort(nettyResponseFuture, new TimeoutException(message));
4444
}
4545
}

0 commit comments

Comments
 (0)