Admaing commented on PR #18667: URL: https://github.com/apache/dolphinscheduler/pull/18667#issuecomment-6051078668
@SbloodyS Thanks for the review. Both points are addressed in `73df3a90`, now pushed (branch head `12bc8d0120`). **1. Parse JobIDs emitted by the SQL Client** `TaskConstants.FLINK_APPLICATION_REGEX` now matches both output formats and exposes the id as a capture group: - `flink run` → `JobID <id>` - Flink SQL Client → `Job ID: <id>` ([CliClient#L587-L592](https://github.com/apache/flink/blob/release-1.16/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java#L587-L592)) `FlinkTask.findAppId()` reads `matcher.group(1)` instead of the hardcoded `substring(6)`, so SQL submissions are now cancelled through the CLI instead of falling back to killing the client, and `savePoint()` no longer reports a missing JobID. Regression tests use the actual SQL-client line: - `FlinkTaskTest#testCancelApplicationCancelSqlClientJobThroughFlinkCli` - `FlinkStreamTaskTest#testSavePointCommandParsesSqlClientJobId` **2. Preserve cluster targeting when triggering savepoints** `FlinkArgsUtils.buildSavePointCommandLine(jobId, yarnApplicationId)` appends the YARN application id as the `-yid` targeting option, in the order documented by [Trigger a Savepoint with YARN](https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/ops/state/savepoints/#trigger-a-savepoint-with-yarn): flink savepoint <jobId> -yid application_1700000000000_0001 `FlinkStreamTask.savePoint()` resolves the JobID through `getFlinkJobIds()` and the application id through `getApplicationIds()`, and keeps them separate: the JobID is the savepoint target, the application id only targets the cluster, and neither is written to `context.appIds`. No `-yid` is added when the task was not submitted to a resource manager. The tests now assert the full argument list instead of relying on the mocked `executeFlinkCommand()` result, so a missing targeting option fails the test: - `FlinkStreamTaskTest#testSavePointCommand` — expects `... savepoint <jobId> -yid application_1700000000000_0001` - `FlinkStreamTaskTest#testSavePointCommandWithoutYarnApplicationId` - `FlinkArgsUtilsTest#testBuildSavePointCommandLineWithYarnApplicationId` **Verification** `./mvnw -pl dolphinscheduler-task-plugin/dolphinscheduler-task-flink,dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream -am test` → task-api 114, flink 18, flink-stream 14 tests pass; `spotless:check` passes. All the earlier comments (task environment reuse, cancellation failure propagation, CLI output draining, savepoint failure propagation, JobID vs application id separation) are addressed in the same branch. -- 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]
