Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix wrong update checkAllLedgersTime when ledgerReplication disabled (#…
…3939) ### Motivation When ledgerReplication disabled, we don't need to register `checkAllLedgersTime` failedEvent because we already skipped the check and didn't encounter any exception. ```java Stopwatch stopwatch = Stopwatch.createStarted(); boolean checkSuccess = false; try { if (!isLedgerReplicationEnabled()) { LOG.info("Ledger replication disabled, skipping checkAllLedgers"); checkSuccess = true; <= here return; } LOG.info("Starting checkAllLedgers"); checkAllLedgers(); ...... checkSuccess = true; } catch (InterruptedException ie) { ...... } finally { if (!checkSuccess) { long checkAllLedgersDuration = stopwatch.stop().elapsed(TimeUnit.MILLISECONDS); auditorStats.getCheckAllLedgersTime() .registerFailedEvent(checkAllLedgersDuration, TimeUnit.MILLISECONDS); } } ```
- Loading branch information