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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]