Skip to content

Commit

Permalink
Make pending responses log messages consistent (#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg authored May 13, 2024
1 parent dca81cb commit ce2b98a
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
if (persistentConnection) {
pendingResponses += 1;
if (HttpServerOperations.log.isDebugEnabled()) {
HttpServerOperations.log.debug(format(ctx.channel(), "Increasing pending responses, now {}"),
HttpServerOperations.log.debug(format(ctx.channel(), "Increasing pending responses count: {}"),
pendingResponses);
}
persistentConnection = isKeepAlive(request);
Expand All @@ -181,7 +181,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
if (pendingResponses > 1) {
if (HttpServerOperations.log.isDebugEnabled()) {
HttpServerOperations.log.debug(format(ctx.channel(), "Buffering pipelined HTTP request, " +
"pending response count: {}, queue: {}"),
"pending responses count: {}, queue: {}"),
pendingResponses,
pipelined != null ? pipelined.size() : 0);
}
Expand Down Expand Up @@ -259,7 +259,7 @@ else if (persistentConnection && pendingResponses == 0) {
else if (overflow) {
if (HttpServerOperations.log.isDebugEnabled()) {
HttpServerOperations.log.debug(format(ctx.channel(), "Buffering pipelined HTTP content, " +
"pending response count: {}, pending pipeline:{}"),
"pending responses count: {}, queue: {}"),
pendingResponses,
pipelined != null ? pipelined.size() : 0);
}
Expand Down Expand Up @@ -327,7 +327,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
if (!shouldKeepAlive()) {
if (HttpServerOperations.log.isDebugEnabled()) {
HttpServerOperations.log.debug(format(ctx.channel(), "Detected non persistent http " +
"connection, preparing to close"),
"connection, preparing to close. Pending responses count: {}"),
pendingResponses);
}
ctx.write(msg, promise.unvoid())
Expand All @@ -347,15 +347,15 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
nonInformationalResponse = false;
pendingResponses -= 1;
if (HttpServerOperations.log.isDebugEnabled()) {
HttpServerOperations.log.debug(format(ctx.channel(), "Decreasing pending responses, now {}"),
HttpServerOperations.log.debug(format(ctx.channel(), "Decreasing pending responses count: {}"),
pendingResponses);
}
}

if (pipelined != null && !pipelined.isEmpty()) {
if (HttpServerOperations.log.isDebugEnabled()) {
HttpServerOperations.log.debug(format(ctx.channel(), "Draining next pipelined " +
"request, pending response count: {}, queued: {}"),
"HTTP request, pending responses count: {}, queued: {}"),
pendingResponses, pipelined.size());
}
ctx.executor()
Expand Down

0 comments on commit ce2b98a

Please sign in to comment.