aloyszhang commented on a change in pull request #2887:
URL: https://github.com/apache/bookkeeper/pull/2887#discussion_r748723162
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
##########
@@ -714,12 +717,14 @@ public BookieImpl(ServerConfiguration conf, StatsLogger
statsLogger,
this.stateManager.transitionToReadOnlyMode();
}
}
-
+ this.journalExistCountDown = new CountDownLatch(1);
// instantiate the journals
journals = Lists.newArrayList();
for (int i = 0; i < journalDirectories.size(); i++) {
- journals.add(new Journal(i, journalDirectories.get(i),
- conf, ledgerDirsManager, statsLogger.scope(JOURNAL_SCOPE),
allocator));
+ Journal journal = new Journal(i, journalDirectories.get(i),
+ conf, ledgerDirsManager, statsLogger.scope(JOURNAL_SCOPE),
allocator);
+ journal.setThreadAliveCounterDown(journalExistCountDown);
Review comment:
Actually, if we decide whether a bookie thread should exit by the
CountDownLatch, many behaviours in the unit test are broken even if `Journal`
has two constructors.
For lots of tests, the `Journal` does not have the CountDownLatch, shutdown
the `BookieImpl` or stop the `BookieServer` will be blocked.
--
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]