014-code opened a new pull request, #30046: URL: https://github.com/apache/flink/pull/30046
## What is the purpose of the change Fix [FLINK-41566](https://issues.apache.org/jira/browse/FLINK-41566): closing the safety-net user-code classloader leaves JARs opened through `getResourceAsStream` open. Delegate resource-stream access to the inner classloader so it owns and closes those JARs. ## Brief change log - Delegate `SafetyNetWrapperClassLoader.getResourceAsStream` through `ensureInner()`. - Add a parameterized regression test for parent-first and child-first loading that reads a real JAR resource and verifies that the cached `JarFile` is closed with the loader. ## Verifying this change - Red-green check: both new parameterized cases fail against the original implementation and pass with the fix. - Java 17, Maven Wrapper 3.9.16: 13 tests passed in `FlinkUserCodeClassLoadersTest` and `FlinkUserCodeClassLoaderTest`, with the reactor dependencies built from this checkout: ```text ./mvnw.cmd -pl flink-core -am -Drat.skip=true -Dflink.forkCountUnitTest=0 -Dtest=FlinkUserCodeClassLoadersTest,FlinkUserCodeClassLoaderTest -Dsurefire.failIfNoSpecifiedTests=false test ``` - Checkstyle, Spotless, and `git diff --check` passed. - Draft validation gap: full `clean verify` has not passed. Rat was stopped after prolonged license-matching regex processing; the successful targeted run skips it. Default forked Surefire execution printed Windows "Access is denied" before starting tests, so the passing run uses in-process execution. Non-Windows execution and the full module test suite have not been run. ## Does this pull request potentially affect one of the following parts: - Dependencies: no - Public API: no; the changed class is internal - Serializers: no - Runtime per-record code paths: no - Deployment or recovery: yes, user-code classloader resource cleanup; no scheduling or checkpoint protocol changes - S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: OpenAI Codex (GPT-6) -- 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]
