Skip to content

[ISSUE #10462] Fix resource leaks and lifecycle issues#10476

Open
lizhimins wants to merge 1 commit into
apache:developfrom
lizhimins:feature/10462-resource
Open

[ISSUE #10462] Fix resource leaks and lifecycle issues#10476
lizhimins wants to merge 1 commit into
apache:developfrom
lizhimins:feature/10462-resource

Conversation

@lizhimins

Copy link
Copy Markdown
Member

What is the purpose of the change

Part of #10462

Fix resource leaks and improve lifecycle management in tiered storage module.

Brief changelog

  • FileSegment close() waits for in-flight commit (30s timeout)
  • PosixFileSegment: store RAF references to prevent handle leaks
  • MessageStoreExecutor shutdown(): add awaitTermination(30s)
  • Remove MessageStoreExecutor singleton pattern
  • Remove fileRecyclingExecutor (wrong thread name, unused)
  • Change MessageStoreExecutor fields from public to private with getters
  • FlatFileFactory: remove test constructor that leaked thread pool
  • FlatMessageFile: remove dead inFlightRequestMap field
  • TieredMessageStore: reorder shutdown (dispatcher->index->executor->file->next)
  • Update all tests to pass executor to FlatFileFactory and shutdown in @after

Verifying this change

  • mvn compile succeeds
  • mvn test -pl tieredstore passes (112 tests, 0 failures)

🤖 Generated with Claude Code

…d storage

- FileSegment close() waits for in-flight commit (30s timeout)
- PosixFileSegment stores RAF references to prevent handle leaks
- MessageStoreExecutor shutdown adds awaitTermination(30s)
- Remove MessageStoreExecutor singleton pattern
- Remove fileRecyclingExecutor (wrong thread name, unused)
- Change MessageStoreExecutor fields from public to private with getters
- FlatFileFactory removes test constructor that leaked thread pool
- FlatMessageFile removes dead inFlightRequestMap field
- TieredMessageStore reorders shutdown: dispatcher->index->executor->file->next
- Update all tests to pass executor to FlatFileFactory and shutdown in @after

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.17073% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.01%. Comparing base (a6fb9e2) to head (f707726).
⚠️ Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
...che/rocketmq/tieredstore/MessageStoreExecutor.java 50.00% 5 Missing and 2 partials ⚠️
...pache/rocketmq/tieredstore/TieredMessageStore.java 60.00% 0 Missing and 2 partials ⚠️
...che/rocketmq/tieredstore/provider/FileSegment.java 66.66% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10476      +/-   ##
=============================================
- Coverage      48.03%   48.01%   -0.03%     
- Complexity     13286    13301      +15     
=============================================
  Files           1376     1377       +1     
  Lines         100558   100646      +88     
  Branches       12985    12999      +14     
=============================================
+ Hits           48305    48325      +20     
- Misses         46333    46380      +47     
- Partials        5920     5941      +21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oss-sentinel-ai oss-sentinel-ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Approved ✅

PR: #10476 — Fix resource leaks and lifecycle issues
Type: Bug fix (18 files, +108/-63)

Assessment

Fixes resource leaks in tiered storage: FileSegment close() waits for in-flight commits, PosixFileSegment stores RAF references to prevent handle leaks, MessageStoreExecutor shutdown improvements.

Verdict

✅ Solid resource management fixes. Part of #10462.


🤖 Automated review by oss-sentinel-ai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants