sijie commented on a change in pull request #7319:
URL: https://github.com/apache/pulsar/pull/7319#discussion_r443102544



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -3177,8 +3177,7 @@ protected void asyncCreateLedger(BookKeeper bookKeeper, 
ManagedLedgerConfig conf
                 digestType, config.getPassword(), cb, ledgerCreated, 
finalMetadata);
         scheduledExecutor.schedule(() -> {
             if (!ledgerCreated.get()) {
-                ledgerCreated.set(true);
-                cb.createComplete(BKException.Code.TimeoutException, null, 
null);
+                cb.createComplete(BKException.Code.TimeoutException, null, 
ledgerCreated);

Review comment:
       The callback is synchronized at ManagedLedgerImpl. So there is no race 
condition here.




----------------------------------------------------------------
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]


Reply via email to