merlimat commented on code in PR #4926:
URL: https://github.com/apache/bookkeeper/pull/4926#discussion_r4460353880


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java:
##########
@@ -619,7 +619,10 @@ private void watchBookieChanges() throws BKException {
      */
     public void shutdown() {
         log.info("Shutting down auditor");
-        executor.shutdown();
+        // Interrupt the running audit rather than wait for it: an audit can 
wait for the ledger
+        // replication to be enabled for as long as it stays disabled, and 
shutdown() would still
+        // run the audit delayed for a lost bookie. The next auditor runs the 
audits again.
+        executor.shutdownNow();

Review Comment:
   Fixed in 03994c43f2: `checkAllLedgers()` now closes the check's client with 
the interrupt status cleared and restores it afterwards, so 
`BookKeeper.close()` no longer stops at its first wait 
(`scheduler.awaitTermination()`). The new 
`testShutdownDuringCheckAllLedgersClosesItsClient` shuts the auditor down while 
the check waits for the ledgers, and asserts that the check's client stopped 
its worker threads and closed its ZooKeeper session; it fails without the fix.
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_



-- 
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]

Reply via email to