Log at debug the first error when adding a tx for the sender fails (#6846)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
pull/6873/head
Fabio Di Fabio 8 months ago committed by GitHub
parent 42bc8508bc
commit 5e93b69503
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 28
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/LayeredPendingTransactions.java

@ -111,23 +111,25 @@ public class LayeredPendingTransactions implements PendingTransactions {
final Throwable throwable) {
// in case something unexpected happened, log this sender txs, force a reconcile and retry
// another time
// ToDo: demote to debug when Layered TxPool is out of preview
LOG.warn(
"Unexpected error {} when adding transaction {}, current sender status {}",
throwable,
pendingTransaction.toTraceLog(),
prioritizedTransactions.logSender(pendingTransaction.getSender()));
LOG.warn("Stack trace", throwable);
LOG.atDebug()
.setMessage(
"Unexpected error when adding transaction {}, current sender status {}, force a reconcile and retry")
.setCause(throwable)
.addArgument(pendingTransaction::toTraceLog)
.addArgument(() -> prioritizedTransactions.logSender(pendingTransaction.getSender()))
.log();
reconcileSender(pendingTransaction.getSender(), stateSenderNonce);
try {
return prioritizedTransactions.add(pendingTransaction, nonceDistance);
} catch (final Throwable throwable2) {
LOG.warn(
"Unexpected error {} when adding transaction {}, current sender status {}",
throwable,
pendingTransaction.toTraceLog(),
prioritizedTransactions.logSender(pendingTransaction.getSender()));
LOG.warn("Stack trace", throwable);
// the error should have been solved by the reconcile, logging at higher level now
LOG.atWarn()
.setCause(throwable2)
.setMessage(
"Unexpected error when adding transaction {} after reconciliation, current sender status {}")
.addArgument(pendingTransaction.toTraceLog())
.addArgument(prioritizedTransactions.logSender(pendingTransaction.getSender()))
.log();
return INTERNAL_ERROR;
}
}

Loading…
Cancel
Save