[fix][broker]fix multi invocation for ledger createComplete
### Motivation
fix multi invocation for ledger `createComplete`
### Modifications
Only call `createComplete` at the point of creating ledger timeout if the ledger is not created normally
@@ -3932,12 +3932,12 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
if (log.isDebugEnabled()) {
log.debug("[{}] Timeout creating ledger", name);
}
+ cb.createComplete(BKException.Code.TimeoutException, null, ledgerCreated);
} else {
if (log.isDebugEnabled()) {
log.debug("[{}] Ledger already created when timeout task is triggered", name);
}
}
- cb.createComplete(BKException.Code.TimeoutException, null, ledgerCreated);
}, config.getMetadataOperationsTimeoutSeconds(), TimeUnit.SECONDS);
}
