-
Notifications
You must be signed in to change notification settings - Fork 5k
[Improvement-17908][Flink] Make -sae parameter configurable in UI with default off #17909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…ent task termination The -sae (--shutdownOnAttachedExit) parameter is only suitable for attached mode where the CLI stays connected and waits for the job to complete. However, YARN Application mode runs in detached mode where the CLI exits after submission, causing the -sae parameter to trigger cluster shutdown and terminate the job unexpectedly. Changes: - Only add -sae parameter for non-APPLICATION deploy modes - Update test cases to reflect the new behavior
| // Note: -sae should NOT be used for APPLICATION mode, as it runs in detached mode on YARN | ||
| if (deployMode != FlinkDeployMode.APPLICATION) { | ||
| args.add(FlinkConstants.FLINK_SHUTDOWN_ON_ATTACHED_EXIT); // -sae | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make it configurable in UI and set it as off by default.
|
Hi @SbloodyS , thank you for the review feedback! I understand the requirement to make the Current SituationThe current PR removes if (deployMode != FlinkDeployMode.APPLICATION) {
args.add(FlinkConstants.FLINK_SHUTDOWN_ON_ATTACHED_EXIT);
}Proposed SolutionI'''d like to propose adding a UI-configurable option for the Implementation Plan
Benefits
QuestionsBefore proceeding with implementation, I'''d like to confirm:
Looking forward to your feedback! Thanks! |
|
@chris-fast Excellent. Your description is very accurate and correct. Please modify this PR according to your description. |
…h default off Changes: - Add shutdownOnAttachedExit field to FlinkParameters with enhanced JavaDoc - Change logic from hardcoded deployMode check to configuration-based - Add UI switch control in Flink task form (positioned after Yarn Queue) - Add comprehensive test cases for all scenarios (null, false, true, APPLICATION mode) - Add Chinese and English i18n translations - Default value: false (disabled for safety and backward compatibility) This addresses the reviewer's feedback to make the -sae parameter configurable via UI instead of hardcoded behavior based on deploy mode. The implementation uses Boolean type (three-state: null/false/true) to ensure backward compatibility with existing tasks.
|
@SbloodyS I've updated the PR according to the plan, PTAL. Thanks! |
|



What is the purpose of the change
Fixes #17908
The
-sae(--shutdownOnAttachedExit) parameter was causing Flink tasks in YARN Application mode to terminate unexpectedly. Based on reviewer feedback, this parameter is now configurable via the UI instead of being hardcoded based on deploy mode.Root Cause
Previously, the
-saeparameter was automatically added for all non-APPLICATION modes. This hardcoded behavior didn't provide users with the flexibility to control this parameter based on their specific use cases.Solution
Made the
-saeparameter fully configurable through the UI:shutdownOnAttachedExitfield toFlinkParametersBrief changelog
shutdownOnAttachedExitfield toFlinkParameterswith enhanced JavaDocFlinkArgsUtils.buildRunCommandLine()to use configuration-based logicVerifying this change
Test Cases Coverage
New test cases added:
testRunJarWithShutdownOnAttachedExitEnabled()- Explicitly enabled (true)testRunJarWithShutdownOnAttachedExitDisabled()- Explicitly disabled (false)testRunJarWithShutdownOnAttachedExitInApplicationMode()- APPLICATION mode with enabledExisting tests updated:
-saeparameterBehavior Matrix
-saeAdded?Backward Compatibility
✅ Fully backward compatible:
Booleantype (three-state: null/false/true)nullvalue represents existing tasks (no -sae parameter)falsevalue represents explicitly disabledtruevalue represents explicitly enabledUI Changes
A new switch control "Shutdown On Attached Exit" has been added to the Flink task configuration form:
-saeparameter to Flink commandRelated issues
Fixes #17908