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 execute on net…
Browse files Browse the repository at this point in the history
…ty threa… (#2007)

Fix:  follow to #2006
  • Loading branch information
zhouxy0809 authored Oct 8, 2023
1 parent 014340d commit db4a9ad
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 db4a9ad

Please sign in to comment.