mimaison commented on code in PR #23316:
URL: https://github.com/apache/kafka/pull/23316#discussion_r3980671136
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LocalLog.java:
##########
@@ -309,23 +309,29 @@ public void updateLogEndOffset(long endOffset) {
}
/**
- * Close file handlers used by log but don't write to disk.
+ * Close the segments of the log, swallowing any exceptions from closing
segments.
* This is called if the log directory is offline.
+ *
+ * @throws KafkaStorageException if the log is already closed
*/
- public void closeHandlers() {
- segments.closeHandlers();
- isMemoryMappedBufferClosed = true;
+ public void closeQuietly() {
+ checkIfClosed();
Review Comment:
I couldn't come up with any scenarios that would lead to a double closure.
That said I'm fine being safe, at least for now, so we can backport this
without risking regressions. So I've replaced `checkIfClosed` with returns.
--
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]