Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve passthru warn logs for max payload size exceeding #2173

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public class PassThroughConstants {
public static final String HTTP_PUT = "PUT";
public static final String HTTP_OPTIONS = "OPTIONS";
public static final String HTTP_CONNECT = "CONNECT";
public static final String HTTP_METHOD = "HTTP_METHOD";

//Constant to specify the socket timeout
public static final String HTTP_SOCKET_TIMEOUT = "HTTP_SOCKET_TIMEOUT";
Expand Down Expand Up @@ -274,4 +275,5 @@ public class PassThroughConstants {
//default header that carries the correlation ID. Header name is configurable at passthru-http.properties
public static final String CORRELATION_DEFAULT_HEADER = "activityid";
public static final String TRANSPORT_LATENCY_LOGGER = "transport-latency";
public static final String TRANSPORT_IN_URL = "TransportInURL";
}
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ public void inputReady(NHttpServerConnection conn,

if (messageSizeSum > validMaxMessageSize) {
log.warn("Payload exceeds valid payload size range, hence discontinuing chunk stream at "
+ messageSizeSum + " bytes to prevent OOM.");
+ messageSizeSum + " bytes to prevent OOM for"
+ " URI : " + request.getUri()
+ ", Method : " + request.getMethod()
+ ", Correlation ID: " + request.getHeaders().get(PassThroughConstants.CORRELATION_DEFAULT_HEADER)
);
dropSourceConnection(conn);
metrics.exceptionOccured();
conn.getContext().setAttribute(PassThroughConstants.SOURCE_CONNECTION_DROPPED, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,11 @@ public void inputReady(NHttpClientConnection conn, ContentDecoder decoder) {

if (messageSizeSum > validMaxMessageSize) {
log.warn("Payload exceeds valid payload size range, hence discontinuing chunk stream at "
+ messageSizeSum + " bytes to prevent OOM.");
+ messageSizeSum + " bytes to prevent OOM for"
+ " URI : " + msgCtx.getProperty(PassThroughConstants.TRANSPORT_IN_URL)
+ ", Method : " + msgCtx.getProperty(PassThroughConstants.HTTP_METHOD)
+ ", Correlation ID: " + msgCtx.getProperty(CorrelationConstants.CORRELATION_ID)
);
dropTargetConnection(conn);
response.getPipe().forceProducerComplete(decoder);
}
Expand Down
Loading