jagath25 opened a new pull request, #29473:
URL: https://github.com/apache/flink/pull/29473

   ## What is the purpose of the change
   
   REST JAR handlers currently build a `PackagedProgram` in 
`JarHandlerContext.applyToConfiguration` and build another one for run or plan 
execution. The first program is never closed. Its user-code classloader can 
keep the uploaded JAR open after the upload is deleted, causing deleted files 
to continue consuming JobManager disk space on repeated submissions. This 
addresses [FLINK-35376](https://issues.apache.org/jira/browse/FLINK-35376).
   
   ## Brief change log
   
   - Apply request options before constructing a program, then derive JAR and 
classpath options from the program owned by the run, plan, or application 
handler.
   - Close the run or application program if setting its derived configuration 
fails synchronously.
   - Add a regression test showing that applying request options does not open 
the JAR.
   
   ## Verifying this change
   
   - `JarHandlerUtilsTest`, `JarRunHandlerParameterTest`, 
`JarPlanHandlerParameterTest`, and `JarRunApplicationHandlerParameterTest`: 35 
tests passed with `mvn -pl flink-runtime-web -am ... test` on JDK 17; Spotless 
and `git diff --check` passed.
   - Manually exercised the Flink 1.20.1 REST upload/run/delete path in an 
isolated session cluster: before the change, six finished WordCount jobs left 
six deleted-open upload JARs; with the change, the same three batch and three 
streaming submissions left none. This test covered the run handler path on 
1.20.1; the master branch adds the application handler call site.
   
   ## 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: JobManager REST submission, 
yes; checkpointing and recovery, no
   - The S3 file system connector: no
   
   ## Documentation
   
   - Does this pull request introduce a new feature? no
   
   ---
   
   ##### 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]

Reply via email to