Repository navigation
Conversation
…ndlers Build one PackagedProgram per REST JAR request and derive pipeline JAR and classpath configuration from the program owned by the handler. This prevents an unclosed duplicate user-code classloader from retaining deleted upload JARs. Close the program if configuration fails before the asynchronous handler cleanup takes ownership. Generated-by: OpenAI Codex (GPT-6)
Collaborator
…ailure and completion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…am owner Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
@flinkbot run azure |
1 similar comment
Author
|
@flinkbot run azure |
- PackagedProgramApplication.closeProgram() now atomically clears the program field, making close idempotent across finish + dispose and ensuring a closed program is no longer observable via getPackagedProgram(); close failures are logged instead of swallowed. - JarRunApplicationHandler disposes the application on any submission failure, not only pre-creation ones, closing the leak window where the submit RPC failed before the Dispatcher registered the application. Application.dispose() is idempotent, so this is safe when the Dispatcher already disposed a rejected application. - Document in Dispatcher that post-registration failures are cleaned up via the regular execution/dispose path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
REST JAR handlers currently build a
PackagedPrograminJarHandlerContext.applyToConfigurationand 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.Brief change log
PackagedProgramApplicationis created. Afterwards the application owns the program, andDispatcher.submitApplicationdisposes applications it rejects or fails to register.PackagedProgramheld byPackagedProgramApplicationwhen the application finishes or is disposed.JarPlanHandlernow builds its program inside the async task, so a missing JAR returns 400 instead of an unstrippedCompletionException(500).PackagedProgramApplicationcloses its program on finish, on dispose and after recovery, that a rejected duplicate application is disposed, and that a missing JAR fails the plan handler asynchronously with 400.Verifying this change
JarHandlerUtilsTest,JarRunHandlerParameterTest,JarPlanHandlerParameterTest, andJarRunApplicationHandlerParameterTest: 38 tests (plusPackagedProgramApplicationTest, 37 tests, andDispatcherApplicationTest, 27 tests) passed withmvn -pl flink-runtime-web -am ... teston JDK 17; Spotless andgit diff --checkpassed.POST /jars/upload->POST /jars/:jarId/run-> wait FINISHED ->DELETE /jars/:jarId, three times:lsofon the JobManager showed no deleted-but-open upload JARs.POST /jars/:jarId/run-application: HTTP 202, job FINISHED; a second submission with the sameapplicationIdwas rejected with HTTP 400 (DuplicateApplicationSubmissionException) and disposed; after deleting both uploaded JARs,lsofagain showed no deleted-but-open JARs.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex (GPT-6)