Skip to content

Commit 272cefe

Browse files
committed
issue?
1 parent 99bddaf commit 272cefe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

storage/src/test/java/org/apache/kafka/storage/internals/log/UnifiedLogTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ public void testDeleteOldSegments() throws IOException {
465465
.withRetentionMs(999)
466466
.build();
467467
log = createLog(logDir, logConfig);
468-
// avoid close after test because it is closed in this test
468+
// Avoid close after test because it is deleted in this test. See line 517.
469469
logsToClose.remove(log);
470470

471471
// append some messages to create some segments
@@ -513,6 +513,10 @@ public void testDeleteOldSegments() throws IOException {
513513
log.appendAsLeader(records.get(), 0);
514514
}
515515

516+
// Bug? Due to log.delete() we can't close the unifiedLog
517+
// because we delete log and the memory map is closed.
518+
// When we close UnifiedLog, it will check that memory map again and
519+
// will throw KafkaStorageException.
516520
log.delete();
517521
assertEquals(0, log.numberOfSegments(), "The number of segments should be 0");
518522
assertEquals(0, log.deleteOldSegments(), "The number of deleted segments should be zero.");

0 commit comments

Comments
 (0)