labuladong commented on code in PR #19346:
URL: https://github.com/apache/pulsar/pull/19346#discussion_r1089896347
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -1554,16 +1554,16 @@ public void operationComplete(Void v, Stat stat) {
log.debug("[{}] Updating of ledgers list after create
complete. version={}", name, stat);
}
ledgersStat = stat;
- ledgers.put(lh.getId(), newLedger);
- currentLedger = lh;
- currentLedgerEntries = 0;
- currentLedgerSize = 0;
- metadataMutex.unlock();
- updateLedgersIdsComplete();
synchronized (ManagedLedgerImpl.this) {
+ ledgers.put(lh.getId(), newLedger);
+ currentLedger = lh;
+ currentLedgerEntries = 0;
+ currentLedgerSize = 0;
+ updateLedgersIdsComplete();
mbean.addLedgerSwitchLatencySample(System.currentTimeMillis()
Review Comment:
Is it necessary to move `updateLedgersIdsComplete()` into the synchronized
block? I see before #16420 this method is out of synchronized too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]