You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "1996fanrui (via GitHub)" <gi...@apache.org> on 2026/05/15 11:35:00 UTC
[PR] [hotfix][state/tests] Dispose keyed state backend in testMapStateWithNullValue [flink]
1996fanrui opened a new pull request, #28168:
URL: https://github.com/apache/flink/pull/28168
## What is the purpose of the change
`StateBackendTestBase#testMapStateWithNullValue` creates a `CheckpointableKeyedStateBackend` via `createKeyedBackend(...)` but never closes/disposes it, leaking the resources held by the backend. Every other test in this file already wraps the body in `try { ... } finally { IOUtils.closeQuietly(backend); backend.dispose(); }`; this one was missed when it was added in FLINK-38137.
For most of the existing state backends covered by this suite the leak is harmless (Heap holds no OS resources; RocksDB's compaction threads end with the JVM), but for any state backend that owns long-lived background tasks polling remote state (e.g. cloud-native backends that periodically read a remote manifest), the leaked backend keeps file handles open under the static `@TempDir` and races the class teardown when JUnit deletes that directory — surfacing as `Failed to delete temp directory ...` plus the backend reporting errors on the now-missing files. Adding the missing cleanup eliminates this category of failure outside Flink as well.
## Brief change log
- Wrap the body of `testMapStateWithNullValue` in a `try { ... } finally { IOUtils.closeQuietly(keyedBackend); keyedBackend.dispose(); }` block, matching the cleanup pattern used by every other test in `StateBackendTestBase`.
## 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 `StateBackendTestBase` and its existing implementations and observing that no test logic is affected.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): **no**
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: **no**
- The serializers: **no**
- The runtime per-record code paths (performance sensitive): **no**
- Anything that affects deployment or recovery: **no**
- The S3 file system connector: **no**
## Documentation
- Does this pull request introduce a new feature? **no**
- If yes, how is the feature documented? **not applicable**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state/tests] Dispose keyed state backend in testMapStateWithNullValue [flink]
Posted by "1996fanrui (via GitHub)" <gi...@apache.org>.
1996fanrui commented on PR #28168:
URL: https://github.com/apache/flink/pull/28168#issuecomment-4460937332
Thanks @spuru9 for the review, good catch, and updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state/tests] Dispose keyed state backend in testMapStateWithNullValue [flink]
Posted by "1996fanrui (via GitHub)" <gi...@apache.org>.
1996fanrui merged PR #28168:
URL: https://github.com/apache/flink/pull/28168
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state/tests] Dispose keyed state backend in testMapStateWithNullValue [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #28168:
URL: https://github.com/apache/flink/pull/28168#issuecomment-4459439049
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "493570324e22905dc48650fad8f25d74b0e43e52",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "493570324e22905dc48650fad8f25d74b0e43e52",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 493570324e22905dc48650fad8f25d74b0e43e52 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org