[hotfix][state/tests] Dispose keyed state backend in testMapStateWithNullValue#28168
Merged
1996fanrui merged 1 commit intoMay 16, 2026
Conversation
Collaborator
spuru9
approved these changes
May 15, 2026
Contributor
spuru9
left a comment
There was a problem hiding this comment.
Nice catch on this one. While we're here — three other tests in this file have backend.dispose() in their finally but are also missing the IOUtils.closeQuietly(backend) that every other test pairs with
dispose():
- testKryoRegisteringRestoreResilienceWithRegisteredSerializer (line ~1168)
- testKryoRestoreResilienceWithDifferentRegistrationOrder (line ~1300)
- testPojoRestoreResilienceWithDifferentRegistrationOrder (line ~1402)
Pre-existing and out of scope for this hotfix, but pointing out for similar change.
…NullValue The test creates a CheckpointableKeyedStateBackend via createKeyedBackend but never closes/disposes it, leaking native resources held by the backend. For most state backends in the existing suite this is harmless, but cloud-native backends that own long-lived background tasks (and poll remote state) keep file handles open under the JUnit @tempdir and fail class teardown. Wrap the test body in try/finally with IOUtils.closeQuietly(keyedBackend) and keyedBackend.dispose(), matching the cleanup pattern used by every other test in this file.
4935703 to
42aeab3
Compare
Member
Author
|
Thanks @spuru9 for the review, good catch, and updated. |
1996fanrui
commented
May 16, 2026
Member
Author
1996fanrui
left a comment
There was a problem hiding this comment.
Thanks for the review, merging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
StateBackendTestBase#testMapStateWithNullValuecreates aCheckpointableKeyedStateBackendviacreateKeyedBackend(...)but never closes/disposes it, leaking the resources held by the backend. Every other test in this file already wraps the body intry { ... } finally { IOUtils.closeQuietly(backend); backend.dispose(); }; this one was missed when it was added in FLINK-38137.Brief change log
testMapStateWithNullValuein atry { ... } finally { IOUtils.closeQuietly(keyedBackend); keyedBackend.dispose(); }block, matching the cleanup pattern used by every other test inStateBackendTestBase.Verifying this change
This change is a test-side resource cleanup with no behavior change for production code paths. It can be verified by running
StateBackendTestBaseand its existing implementations and observing that no test logic is affected.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation