gaozhangmin commented on code in PR #3541:
URL: https://github.com/apache/bookkeeper/pull/3541#discussion_r997677788
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java:
##########
@@ -1224,22 +1224,37 @@ private CompletableFuture<?>
publishSuspectedLedgersAsync(Collection<String> mis
LOG.info("Following ledgers: {} of bookie: {} are identified as
underreplicated", ledgers, missingBookies);
numUnderReplicatedLedger.registerSuccessfulValue(ledgers.size());
LongAdder underReplicatedSize = new LongAdder();
+
FutureUtils.processList(
Lists.newArrayList(ledgers),
- ledgerId ->
-
ledgerManager.readLedgerMetadata(ledgerId).whenComplete((metadata, exception)
-> {
+ ledgerId -> {
+ try {
+ openLedgerNoRecoverySemaphore.acquire();
+ } catch (InterruptedException e) {
+ LOG.error("Unable to acquire open ledger operation
semaphore ", e);
+ Thread.currentThread().interrupt();
Review Comment:
Why? Since `processList` is processing the list of items one by one
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java:
##########
@@ -1224,22 +1224,37 @@ private CompletableFuture<?>
publishSuspectedLedgersAsync(Collection<String> mis
LOG.info("Following ledgers: {} of bookie: {} are identified as
underreplicated", ledgers, missingBookies);
numUnderReplicatedLedger.registerSuccessfulValue(ledgers.size());
LongAdder underReplicatedSize = new LongAdder();
+
FutureUtils.processList(
Lists.newArrayList(ledgers),
- ledgerId ->
-
ledgerManager.readLedgerMetadata(ledgerId).whenComplete((metadata, exception)
-> {
+ ledgerId -> {
+ try {
+ openLedgerNoRecoverySemaphore.acquire();
+ } catch (InterruptedException e) {
+ LOG.error("Unable to acquire open ledger operation
semaphore ", e);
+ Thread.currentThread().interrupt();
Review Comment:
Why? Since `processList` is processing the list of items one by one.
@hangc0276
--
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]