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

Commit

Permalink
[fix] Run messageReadStats metrics registerFailedEvent on netty threa…
Browse files Browse the repository at this point in the history
…ds in PartitionLog
  • Loading branch information
zhouxy0809 committed Sep 22, 2023
1 parent 014340d commit 1a808ad
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,10 @@ public void readEntriesFailed(ManagedLedgerException exception, Object ctx) {
if (exception instanceof ManagedLedgerException.ManagedLedgerFencedException) {
invalidateCacheOnTopic.accept(fullPartitionName);
}
messageReadStats.registerFailedEvent(
MathUtils.elapsedNanos(startReadingMessagesNanos), TimeUnit.NANOSECONDS);
long failedLatencyNanos = MathUtils.elapsedNanos(startReadingMessagesNanos);
eventExecutor.execute(() -> {
messageReadStats.registerFailedEvent(failedLatencyNanos, TimeUnit.NANOSECONDS);
});
readFuture.completeExceptionally(exception);
}
}, null, PositionImpl.LATEST);
Expand Down

0 comments on commit 1a808ad

Please sign in to comment.