Skip to content

MINOR: Close leaked RemoteLogManager instances in RemoteLogManagerTest - #23604

Open
unknowntpo wants to merge 2 commits into
apache:trunkfrom
unknowntpo:fix-rlm-test-leak
Open

unknowntpo wants to merge 2 commits into
apache:trunkfrom
unknowntpo:fix-rlm-test-leak

Conversation

@unknowntpo

@unknowntpo unknowntpo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Three tests in RemoteLogManagerTest leaked a RemoteLogManager, so
its scheduler threads and metrics outlived the test and could interfere
with the tests that follow

Reviewers: Chia-Ping Tsai
chia7712@gmail.com, liuliu
liuliugit@gmail.com, Ken Huang s7133700@gmail.com

@github-actions github-actions Bot added triage PRs from the community tests Test fixes (including flaky tests) storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature small Small PRs labels Sep 28, 2026
@unknowntpo
unknowntpo marked this pull request as ready for review September 28, 2026 12:45

@chia7712 chia7712 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

.thenReturn(fileInputStream);

RemoteLogManager remoteLogManager = new RemoteLogManager(config, brokerId, logDir, clusterId, time,
try (RemoteLogManager remoteLogManager = new RemoteLogManager(config, brokerId, logDir, clusterId, time,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

testFetchOffsetByTimestampWithTieredStorageDoesNotFetchIndexWhenExistsLocally and testDeletionSkippedForSegmentsBeingCopied also have leak. Would you mind fixing them in this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok fixed.

@unknowntpo unknowntpo changed the title MINOR: Close the RemoteLogManager created in testRemoteReadFetchDataInfo MINOR: Close leaked RemoteLogManager instances in RemoteLogManagerTest Sep 28, 2026
testRemoteReadFetchDataInfo declared a local variable with the same name as
the field, so tearDown closed the field but not the local one. Its scheduler
threads and metrics outlived the test. Use try-with-resources like the other
tests that build their own manager.

Generated-by: Claude Fable 5.1
testFetchOffsetByTimestampWithTieredStorageDoesNotFetchIndexWhenExistsLocally
and testDeletionSkippedForSegmentsBeingCopied reassigned the field without
closing the manager created in setUp. Close it first, as
testRLMOpsWhenMetadataIsNotReady already does.

Generated-by: Claude Fable 5.1

@m1a2st m1a2st left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, LGTM

@github-actions github-actions Bot removed the triage PRs from the community label Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs storage Pull requests that target the storage module tests Test fixes (including flaky tests) tiered-storage Related to the Tiered Storage feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants