Skip to content
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

[Fix-14303][Master] Workflow with sub_process task can't be stopped w… #14343

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

HomminLee
Copy link
Contributor

@HomminLee HomminLee commented Jun 13, 2023

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

This pull request is already covered by existing tests, such as org.apache.dolphinscheduler.server.master.SubProcessTaskTest#testFinish.

@HomminLee
Copy link
Contributor Author

@SbloodyS need a label to continue check

@codecov-commenter
Copy link

codecov-commenter commented Jun 28, 2023

Codecov Report

❗ No coverage uploaded for pull request base (3.1.8-prepare@87481aa). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head b35a14d differs from pull request most recent head 0488491. Consider uploading reports for the commit 0488491 to get more accurate results

@@               Coverage Diff                @@
##             3.1.8-prepare   #14343   +/-   ##
================================================
  Coverage                 ?   38.20%           
  Complexity               ?     3980           
================================================
  Files                    ?      999           
  Lines                    ?    36902           
  Branches                 ?     4265           
================================================
  Hits                     ?    14097           
  Misses                   ?    21191           
  Partials                 ?     1614           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sonarcloud
Copy link

sonarcloud bot commented Jul 4, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug E 8 Bugs
Vulnerability B 9 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 772 Code Smells

27.6% 27.6% Coverage
2.5% 2.5% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Comment on lines +144 to +145
} else if (state.isStop()) {
return TaskExecutionStatus.KILL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we workflow stop is kill?

Copy link
Contributor Author

@HomminLee HomminLee Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@caishunfeng caishunfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@caishunfeng
Copy link
Contributor

The pr target should change to dev branch first?

@HomminLee
Copy link
Contributor Author

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.

@HomminLee
Copy link
Contributor Author

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?

@SbloodyS SbloodyS added bug Something isn't working 3.1.x for 3.1.x version labels Jul 19, 2023
@SbloodyS SbloodyS added this to the 3.1.8 milestone Jul 19, 2023
@SbloodyS SbloodyS merged commit 1e029fb into apache:3.1.8-prepare Jul 19, 2023
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.1.x for 3.1.x version backend bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants