Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #671 from radixdlt/fix/NT-331-revise-log-levels
Browse files Browse the repository at this point in the history
Fix/NT-331 revise log levels - 1.1.1 release branch
  • Loading branch information
dhedey authored Apr 19, 2022
2 parents ae35614 + 1f6a4ab commit 02707a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ private void handleFailure(Future<?> future, ChannelHandlerContext ctx) {
}

private void logAndCloseChannel(ChannelHandlerContext ctx, Throwable cause) {
var affectedEntity = mainHandler.map(Object::toString).orElse("channel");
log.warn("Exception on {} {}, closing channel to prevent resource leak", affectedEntity, cause);
if (log.isTraceEnabled()) {
var affectedEntity = mainHandler.map(Object::toString).orElse("(to a peer via proxy)");
log.trace("Closing channel {} due to {}", affectedEntity, cause);
}

// The channel is closed to prevent a resource leak
ctx.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ public void addToMempool(MempoolAdd mempoolAdd, @Nullable BFTNode origin) {
txn -> {
try {
addToMempool(txn, origin);
} catch (MempoolDuplicateException ex) {
log.trace(
"Transaction {} was not added as it was already in the mempool", txn.getId());
} catch (MempoolRejectedException ex) {
log.debug("Txn rejected from the mempool", ex);
log.debug("Transaction {} was not added to the mempool", txn.getId(), ex);
}
});
}
Expand Down

0 comments on commit 02707a2

Please sign in to comment.