aloyszhang commented on issue #2879: URL: https://github.com/apache/bookkeeper/issues/2879#issuecomment-961748448
The logic about the journal thread exit is as follow: https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java#L1145-L1156 ```java catch (IOException ioe) { LOG.error("I/O exception in Journal thread!", ioe); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); LOG.info("Journal exits when shutting down"); } finally { // There could be packets queued for forceWrite on this logFile // That is fine as this exception is going to anyway take down the // the bookie. If we execute this as a part of graceful shutdown, // close will flush the file system cache making any previous // cached writes durable so this is fine as well. IOUtils.close(LOG, bc); } ``` When breaking the while loop of the journal thread, bookie interrupts the journal thread and closes the BufferedChannel for the journal file. I think it's better to exit all bookie services and maybe we also can add a catch block for Throwable ```java catch (Throwable t) { // print the cause } ``` to check if there are some situations we didn't handle yet. -- 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]
