Admaing commented on PR #18667: URL: https://github.com/apache/dolphinscheduler/pull/18667#issuecomment-6183589746
@SbloodyS Both findings are fixed in `505a1e6e`, with follow-ups in `6605862f` and `8633add7`. **1. Stop the submission client before taking the final JobID snapshot** `cancelApplication()` now stops the client first, waits (bounded to 2s) for the asynchronously collected output through `AbstractCommandExecutor.awaitOutputCollected`, and only then collects the final JobIDs and cancels them — no job can be submitted between the snapshot and the client stop. `FlinkTaskTest#testCancelApplicationCollectsJobIdSubmittedWhileTheClientIsStopped` asserts the order (stop → wait → cancel) and that a job appended to the log while the client is stopped is cancelled as well. **2. Preserve cluster settings configured through SQL SET statements** `getClusterConnectionOptions()` merges `others` with the `SET` statements of `initScript` / `rawScript`, and only statements at a statement boundary are matched, so a `SET` inside a single line string literal or a comment is ignored. Covered by `FlinkArgsUtilsTest#testExtractClusterConnectionOptionsFromSqlScripts` (including the literal and comment case) and `FlinkTaskTest#testCancelApplicationKeepsConnectionOptionsFromSqlScripts`. Known limitations, documented in the javadoc: a multi line string literal whose line begins with `SET` is still matched, and a script which changes the connection between two submitted jobs is represented by the value of the last statement, because the CLI accepts a single connection configuration per control command. **Verification** `./mvnw -pl dolphinscheduler-task-plugin/dolphinscheduler-task-flink,dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream -am test` → task-api 122, flink 41, flink-stream 15 tests pass; `spotless:check` passes. -- 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]
