gaozhangmin commented on code in PR #3548:
URL: https://github.com/apache/bookkeeper/pull/3548#discussion_r999382994
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerOpenOp.java:
##########
@@ -112,12 +112,10 @@ public void initiate() {
* Asynchronously read the ledger metadata node.
*/
bk.getLedgerManager().readLedgerMetadata(ledgerId)
- .whenComplete((metadata, exception) -> {
- if (exception != null) {
- openComplete(BKException.getExceptionCode(exception),
null);
- } else {
- openWithMetadata(metadata);
- }
+ .thenAcceptAsync(this::openWithMetadata,
bk.getScheduler().chooseThread(ledgerId))
+ .exceptionally(exception -> {
+ openComplete(BKException.getExceptionCode(exception),
null);
Review Comment:
This happened if bk is closed, we cannot go inside `whenCompleteAsyncAsync`
, because bk's scheduler is shutdown.
--
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]