Skip to content

Commit 569323f

Browse files
Adding remoteTarget to logger message so clients can be tracked down (#3155)
Motivation: When we get a log entry from `HttpMessageDiscardWatchdogClientFilter`, there is little to no information to go on to start identifying which client this leak may be coming from. Adding some sort of context about the request like the connection id or remote socket address would at least help us correlate this leak to a particular client connection and eventually the code. Modifications: - Added `ConnectionInfo` or `request.effectiveHostAndPort()` info to the logger message. Result: Remote info is included in the log message.
1 parent 2a2323d commit 569323f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/HttpMessageDiscardWatchdogClientFilter.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Single<StreamingHttpResponse> request(final StreamingHttpRequest request)
8181
LOGGER.warn("Discovered un-drained HTTP response message body which has " +
8282
"been dropped by user code - this is a strong indication of a bug " +
8383
"in a user-defined filter. Response payload (message) body must " +
84-
"be fully consumed before retrying.");
84+
"be fully consumed before retrying. connectionInfo={}", connectionContext());
8585
}
8686

8787
return response.transformMessageBody(msgPublisher -> msgPublisher.beforeSubscriber(() -> {
@@ -115,7 +115,8 @@ protected Single<StreamingHttpResponse> request(final StreamingHttpRequester del
115115
LOGGER.warn("Discovered un-drained HTTP response message body which has " +
116116
"been dropped by user code - this is a strong indication of a bug " +
117117
"in a user-defined filter. Response payload (message) body must " +
118-
"be fully consumed before discarding.", cause);
118+
"be fully consumed before discarding. hostAndPort={}",
119+
request.effectiveHostAndPort(), cause);
119120
}
120121
});
121122
}

0 commit comments

Comments
 (0)