Skip to content

Commit

Permalink
Adding remoteTarget to logger message so clients can be tracked down (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
colestanfield authored Jan 14, 2025
1 parent 2a2323d commit 569323f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Single<StreamingHttpResponse> request(final StreamingHttpRequest request)
LOGGER.warn("Discovered un-drained HTTP response message body which has " +
"been dropped by user code - this is a strong indication of a bug " +
"in a user-defined filter. Response payload (message) body must " +
"be fully consumed before retrying.");
"be fully consumed before retrying. connectionInfo={}", connectionContext());
}

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

0 comments on commit 569323f

Please sign in to comment.