Skip to content

Commit 35b5395

Browse files
committed
issue
1 parent 99bddaf commit 35b5395

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 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,9 @@ 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 at that moment, and then the memory map is closed.
518+
// So it will throw KafkaStorageException when closing.
516519
log.delete();
517520
assertEquals(0, log.numberOfSegments(), "The number of segments should be 0");
518521
assertEquals(0, log.deleteOldSegments(), "The number of deleted segments should be zero.");

0 commit comments

Comments
 (0)