You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by mo...@apache.org on 2022/11/19 15:57:16 UTC

[incubator-streampark] branch cluster updated: [bug] Fix yarn per-job and yarn application cancellation failure due to inconsistent ClusterId.

This is an automated email from the ASF dual-hosted git repository.

monster pushed a commit to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/cluster by this push:
     new 2729e9688 [bug] Fix yarn per-job and yarn application cancellation failure due to inconsistent ClusterId.
2729e9688 is described below

commit 2729e9688c2d759127666d524318fd25efe98105
Author: Monster <25...@qq.com>
AuthorDate: Sat Nov 19 23:57:05 2022 +0800

    [bug] Fix yarn per-job and yarn application cancellation failure due to inconsistent ClusterId.
---
 .../console/core/service/impl/ApplicationServiceImpl.java        | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java
index 1c58a46f0..5d58aaeac 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java
@@ -1086,11 +1086,16 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, Appli
         if (!application.getUserId().equals(userId)) {
             FlinkTrackingTask.addCanceledApp(application.getId(), userId);
         }
-
+        String clusterId = null;
+        if (ExecutionMode.isKubernetesMode(application.getExecutionMode())) {
+            clusterId = application.getClusterId();
+        } else if (ExecutionMode.isYarnMode(application.getExecutionMode())) {
+            clusterId = application.getAppId();
+        }
         CancelRequest cancelRequest = new CancelRequest(
             flinkEnv.getFlinkVersion(),
             ExecutionMode.of(application.getExecutionMode()),
-            application.getClusterId(),
+            clusterId,
             application.getJobId(),
             appParam.getSavePointed(),
             appParam.getDrain(),