Skip to content

Commit

Permalink
[FLINK-13553][qs] Add logging to AbstractServerHandler
Browse files Browse the repository at this point in the history
Log every request on trace level.
Log caught exceptions in AsyncRequestTask.
  • Loading branch information
GJL committed May 22, 2020
1 parent 984aa0b commit 564e880
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
final MessageType msgType = MessageSerializer.deserializeHeader(buf);

requestId = MessageSerializer.getRequestId(buf);
LOG.trace("Handling request with ID {}", requestId);

if (msgType == MessageType.REQUEST) {

Expand Down Expand Up @@ -263,6 +264,7 @@ public void run() {
write.addListener(new RequestWriteListener());

} catch (BadRequestException e) {
LOG.debug("Bad request (request ID = {})", requestId, e);
try {
stats.reportFailedRequest();
final ByteBuf err = MessageSerializer.serializeRequestFailure(ctx.alloc(), requestId, e);
Expand All @@ -271,6 +273,7 @@ public void run() {
LOG.error("Failed to respond with the error after failed request", io);
}
} catch (Throwable t) {
LOG.error("Error while handling request with ID {}", requestId, t);
try {
stats.reportFailedRequest();

Expand Down

0 comments on commit 564e880

Please sign in to comment.