eolivelli commented on a change in pull request #8938:
URL: https://github.com/apache/pulsar/pull/8938#discussion_r542170088
##########
File path:
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -1411,9 +1411,21 @@ synchronized void ledgerClosed(final LedgerHandle lh) {
log.debug("[{}] Ledger has been closed id={} entries={}", name,
lh.getId(), entriesInLedger);
}
if (entriesInLedger > 0) {
- LedgerInfo info =
LedgerInfo.newBuilder().setLedgerId(lh.getId()).setEntries(entriesInLedger)
-
.setSize(lh.getLength()).setTimestamp(clock.millis()).build();
- ledgers.put(lh.getId(), info);
+ synchronized (ledgers) {
Review comment:
We are not using synchronized on ledgers variable in other points in
this class.
It looks to me as an inconsistent synchronisation.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]