You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "HomminLee (via GitHub)" <gi...@apache.org> on 2023/06/13 07:23:18 UTC

[GitHub] [dolphinscheduler] HomminLee opened a new pull request, #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

HomminLee opened a new pull request, #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343

   …hen running
   
   <!--Thanks very much for contributing to Apache DolphinScheduler, we are happy that you want to help us improve DolphinScheduler! -->
   
   ## Purpose of the pull request
   
   fix #14303
   
   ## Brief change log
   
   When the sub workflow is finished, check the workflow state and transition to task status.
   
   ## Verify this pull request
   
   <!--*(Please pick either of the following options)*-->
   
   This pull request is already covered by existing tests, such as org.apache.dolphinscheduler.server.master.SubProcessTaskTest#testFinish.
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1619854309

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=14343)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [8 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [9 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [772 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL)
   
   [![27.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '27.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list) [27.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list)  
   [![2.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.5%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list) [2.5% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list)
   
   
   
   ![idea](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png 'idea') Catch issues before they fail your Quality Gate with our IDE extension ![sonarlint](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png 'sonarlint') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1611005595

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=14343)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [8 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [9 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [768 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL)
   
   [![27.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '27.6%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list) [27.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list)  
   [![2.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.5%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list) [2.5% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list)
   
   
   
   ![idea](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png 'idea') Catch issues before they fail your Quality Gate with our IDE extension ![sonarlint](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png 'sonarlint') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1610993921

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=14343)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [8 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [9 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [768 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL)
   
   [![27.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '27.6%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list) [27.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list)  
   [![2.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.5%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list) [2.5% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list)
   
   
   
   ![idea](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png 'idea') Catch issues before they fail your Quality Gate with our IDE extension ![sonarlint](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png 'sonarlint') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] HomminLee commented on a diff in pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "HomminLee (via GitHub)" <gi...@apache.org>.
HomminLee commented on code in PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#discussion_r1255100676


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java:
##########
@@ -129,14 +129,29 @@ private void updateTaskState() {
                 subProcessInstance.getId(),
                 subProcessInstance.getState());
         if (subProcessInstance != null && subProcessInstance.getState().isFinished()) {
-            // todo: check the status and transform
-            taskInstance.setState(TaskExecutionStatus.of(subProcessInstance.getState().getCode()));
+            taskInstance.setState(subProcessFinishedStateTransform(subProcessInstance.getState()));
             taskInstance.setEndTime(new Date());
             dealFinish();
             processService.saveTaskInstance(taskInstance);
         }
     }
 
+    private TaskExecutionStatus subProcessFinishedStateTransform(WorkflowExecutionStatus state) {
+        if (state.isSuccess()) {
+            return TaskExecutionStatus.SUCCESS;
+        } else if (state.isFailure()) {
+            return TaskExecutionStatus.FAILURE;
+        } else if (state.isStop()) {
+            return TaskExecutionStatus.KILL;

Review Comment:
   Stop is workflow state, and kill is task state. AFAK, task has no STOP state (`TaskExecutionStatus` has STOP state, but it has not been used anywhere). `TaskExecutionStatus` has code:
   
   ```
       public boolean isFinished() {
           return isSuccess() || isKill() || isFailure() || isPause();
       }
   ```
   
   Pause workflow has pause task, only kill task state can match stop workflow state.
   
   



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] SbloodyS merged pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "caishunfeng (via GitHub)" <gi...@apache.org>.
caishunfeng commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1624531837

   The pr target should change to dev branch first?


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1610989239

   ## [Codecov](https://app.codecov.io/gh/apache/dolphinscheduler/pull/14343?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > :exclamation: No coverage uploaded for pull request base (`3.1.8-prepare@77a967c`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head bd2335a differs from pull request most recent head 87e45c3. Consider uploading reports for the commit 87e45c3 to get more accurate results
   
   ```diff
   @@               Coverage Diff                @@
   ##             3.1.8-prepare   #14343   +/-   ##
   ================================================
     Coverage                 ?   38.18%           
     Complexity               ?     3971           
   ================================================
     Files                    ?      999           
     Lines                    ?    36890           
     Branches                 ?     4264           
   ================================================
     Hits                     ?    14087           
     Misses                   ?    21189           
     Partials                 ?     1614           
   ```
   
   
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] HomminLee commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "HomminLee (via GitHub)" <gi...@apache.org>.
HomminLee commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1624552588

   > The pr target should change to dev branch first?
   
   In dev branch, sub_process has been refactor #13948 , and there is no relevant code anymore. BTW, I don't know if dev branch have the same issue.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] HomminLee commented on a diff in pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "HomminLee (via GitHub)" <gi...@apache.org>.
HomminLee commented on code in PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#discussion_r1255100676


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java:
##########
@@ -129,14 +129,29 @@ private void updateTaskState() {
                 subProcessInstance.getId(),
                 subProcessInstance.getState());
         if (subProcessInstance != null && subProcessInstance.getState().isFinished()) {
-            // todo: check the status and transform
-            taskInstance.setState(TaskExecutionStatus.of(subProcessInstance.getState().getCode()));
+            taskInstance.setState(subProcessFinishedStateTransform(subProcessInstance.getState()));
             taskInstance.setEndTime(new Date());
             dealFinish();
             processService.saveTaskInstance(taskInstance);
         }
     }
 
+    private TaskExecutionStatus subProcessFinishedStateTransform(WorkflowExecutionStatus state) {
+        if (state.isSuccess()) {
+            return TaskExecutionStatus.SUCCESS;
+        } else if (state.isFailure()) {
+            return TaskExecutionStatus.FAILURE;
+        } else if (state.isStop()) {
+            return TaskExecutionStatus.KILL;

Review Comment:
   STOP is workflow state, and KILL is task state. AFAK, task has no STOP state (`TaskExecutionStatus` has STOP state, but it has not been used anywhere). `TaskExecutionStatus` has code:
   
   ```
       public boolean isFinished() {
           return isSuccess() || isKill() || isFailure() || isPause();
       }
   ```
   
   PAUSE workflow has PAUSE task, only KILL task state can match STOP workflow state, both of these indicate termination.
   
   



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] HomminLee commented on a diff in pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "HomminLee (via GitHub)" <gi...@apache.org>.
HomminLee commented on code in PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#discussion_r1255100676


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java:
##########
@@ -129,14 +129,29 @@ private void updateTaskState() {
                 subProcessInstance.getId(),
                 subProcessInstance.getState());
         if (subProcessInstance != null && subProcessInstance.getState().isFinished()) {
-            // todo: check the status and transform
-            taskInstance.setState(TaskExecutionStatus.of(subProcessInstance.getState().getCode()));
+            taskInstance.setState(subProcessFinishedStateTransform(subProcessInstance.getState()));
             taskInstance.setEndTime(new Date());
             dealFinish();
             processService.saveTaskInstance(taskInstance);
         }
     }
 
+    private TaskExecutionStatus subProcessFinishedStateTransform(WorkflowExecutionStatus state) {
+        if (state.isSuccess()) {
+            return TaskExecutionStatus.SUCCESS;
+        } else if (state.isFailure()) {
+            return TaskExecutionStatus.FAILURE;
+        } else if (state.isStop()) {
+            return TaskExecutionStatus.KILL;

Review Comment:
   STOP is workflow state, and KILL is task state. AFAK, task has no STOP state (`TaskExecutionStatus` has STOP state, but it has not been used anywhere). `TaskExecutionStatus` has code:
   
   ```
       public boolean isFinished() {
           return isSuccess() || isKill() || isFailure() || isPause();
       }
   ```
   
   PAUSE workflow has PAUSE task, only KILL task state can match STOP workflow state.
   
   



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "zhongjiajie (via GitHub)" <gi...@apache.org>.
zhongjiajie commented on code in PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#discussion_r1255083627


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java:
##########
@@ -129,14 +129,29 @@ private void updateTaskState() {
                 subProcessInstance.getId(),
                 subProcessInstance.getState());
         if (subProcessInstance != null && subProcessInstance.getState().isFinished()) {
-            // todo: check the status and transform
-            taskInstance.setState(TaskExecutionStatus.of(subProcessInstance.getState().getCode()));
+            taskInstance.setState(subProcessFinishedStateTransform(subProcessInstance.getState()));
             taskInstance.setEndTime(new Date());
             dealFinish();
             processService.saveTaskInstance(taskInstance);
         }
     }
 
+    private TaskExecutionStatus subProcessFinishedStateTransform(WorkflowExecutionStatus state) {
+        if (state.isSuccess()) {
+            return TaskExecutionStatus.SUCCESS;
+        } else if (state.isFailure()) {
+            return TaskExecutionStatus.FAILURE;
+        } else if (state.isStop()) {
+            return TaskExecutionStatus.KILL;

Review Comment:
   why we workflow stop is kill?



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] HomminLee commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "HomminLee (via GitHub)" <gi...@apache.org>.
HomminLee commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1624567587

   > > The pr target should change to dev branch first?
   > 
   > In dev branch, sub_process has been refactor #13948 , and there is no relevant code anymore. BTW, I don't know if dev branch have the same issue.
   
   I browsed sub_process code in dev branch,  the new logic task framework only use three state: RUNNING, SUCCESS, FAILED.(Reference code: `SubWorkflowAsyncTaskExecuteFunction#getAsyncTaskExecutionStatus`) . Should the framework be improved?
   
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1619861191

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=14343)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG) [8 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY) [9 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT) [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL) [772 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14343&resolved=false&types=CODE_SMELL)
   
   [![27.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '27.6%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list) [27.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_coverage&view=list)  
   [![2.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.5%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list) [2.5% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14343&metric=new_duplicated_lines_density&view=list)
   
   
   
   ![idea](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png 'idea') Catch issues before they fail your Quality Gate with our IDE extension ![sonarlint](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png 'sonarlint') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=sonarcloud-welcome)


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] HomminLee commented on pull request #14343: [Fix-14303][Master] Workflow with sub_process task can't be stopped w…

Posted by "HomminLee (via GitHub)" <gi...@apache.org>.
HomminLee commented on PR #14343:
URL: https://github.com/apache/dolphinscheduler/pull/14343#issuecomment-1596443486

   @SbloodyS need a label to continue check


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org