Skip to content

Commit d82a371

Browse files
author
RongtongJin
committed
Fix resource leak in IndexStoreFile shutdown
Add cleanResources() calls after shutdown() for both mappedFile and compactMappedFile to ensure proper cleanup of memory-mapped buffers and file channels. Change-Id: I2716b4e3b0cd281e89a9d5a00a389dc6048de3e7 Co-developed-by: Cursor <noreply@cursor.com>
1 parent e4170f5 commit d82a371

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tieredstore/src/main/java/org/apache/rocketmq/tieredstore/index/IndexStoreFile.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,11 @@ public void shutdown() {
468468
}
469469
if (this.mappedFile != null) {
470470
this.mappedFile.shutdown(TimeUnit.SECONDS.toMillis(10));
471+
this.mappedFile.cleanResources();
471472
}
472473
if (this.compactMappedFile != null) {
473474
this.compactMappedFile.shutdown(TimeUnit.SECONDS.toMillis(10));
475+
this.compactMappedFile.cleanResources();
474476
}
475477
} catch (Exception e) {
476478
log.error("IndexStoreFile shutdown failed, timestamp: {}, status: {}", this.getTimestamp(), fileStatus.get(), e);

0 commit comments

Comments
 (0)