You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/19 04:36:45 UTC

[GitHub] [pulsar] aloyszhang commented on pull request #18975: [fix][broker]fix multi invocation for ledger createComplete

aloyszhang commented on PR #18975:
URL: https://github.com/apache/pulsar/pull/18975#issuecomment-1357085380

   > Method checkAndCompleteLedgerOpTask has already prevented this.
   
   Of course, `checkAndCompleteLedgerOpTask` can prevent this.
   But we do not need to go into the `createComplete` at all if the ledger creation is complete normally.
   
   Actually, this is introduced by https://github.com/apache/pulsar/pull/7401, before this PR, the processing logic is 
   ```java
    if (!ledgerCreated.get()) {
                   cb.createComplete(BKException.Code.TimeoutException, null, ledgerCreated);
               }
   ```
   and PR#7401 change it to 
   ```java
              if (!ledgerCreated.get()) {
                   if (log.isDebugEnabled()) {
                       log.debug("[{}] Timeout creating ledger", name);
                   }
               } else {
                   if (log.isDebugEnabled()) {
                       log.debug("[{}] Ledger already created when timeout task is triggered", name);
                   }
               }
               cb.createComplete(BKException.Code.TimeoutException, null, ledgerCreated);
   ```
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org