ivankelly commented on a change in pull request #641: Issue-596 Issue-583: Auto replication should honor ensemble placement policy URL: https://github.com/apache/bookkeeper/pull/641#discussion_r145501811
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java ########## @@ -739,19 +684,40 @@ public void openComplete(int rc, final LedgerHandle lh, Object ctx) { asyncOpenLedger(lId, new OpenCallback() { @Override public void openComplete(int newrc, final LedgerHandle newlh, Object newctx) { - if (newrc != Code.OK.intValue()) { + if (newrc != BKException.Code.OK) { LOG.error("BK error close ledger: " + lId, BKException.create(newrc)); - ledgerIterCb.processResult(newrc, null, null); + finalLedgerIterCb.processResult(newrc, null, null); return; } - // do recovery - recoverLedger(bookieSrc, lId, ledgerIterCb, availableBookies); + bkc.mainWorkerPool.submit(() -> { + // do recovery + recoverLedger(bookiesSrc, lId, dryrun, skipOpenLedgers, finalLedgerIterCb); + }); } }, null); return; } } + final AsyncCallback.VoidCallback ledgerIterCb = new AsyncCallback.VoidCallback() { Review comment: Actually, i'd move the definition out to a utility method to clarify what the wrapper is for. VoidCallback closeOnCompleteCb(LedgerHandle lh, VoidCallback cb); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services