Skip to content

Commit

Permalink
Additional change to 12544db
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Jun 24, 2022
1 parent 12544db commit 770a7c3
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -90,7 +90,15 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)

if (msg instanceof LastHttpContent) {
SocketAddress address = ctx.channel().remoteAddress();
promise.addListener(future -> recordWrite(address));
promise.addListener(future -> {
try {
recordWrite(address);
}
catch (RuntimeException e) {
log.warn("Exception caught while recording metrics.", e);
// Allow request-response exchange to continue, unaffected by metrics problem
}
});
}
}
catch (RuntimeException e) {
Expand Down

0 comments on commit 770a7c3

Please sign in to comment.