-
Notifications
You must be signed in to change notification settings - Fork 5k
[Fix-17732] Change workflow instance status to failure when command handle failed #17745
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-17732] Change workflow instance status to failure when command handle failed #17745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses issue #17732 by ensuring that workflow instance status is set to FAILURE when command handling fails during bootstrap. The changes introduce proper error handling and state management when command processing encounters exceptions, preventing workflow instances from being stuck in intermediate states.
Key Changes:
- Adds workflow instance state update to FAILURE in error handling path
- Makes error command movement transactional to ensure atomicity
- Enhances WorkflowGraph with duplicate task name/code validation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
CommandEngine.java |
Adds logic to force update workflow instance state to FAILURE when command bootstrap fails, plus enhanced logging |
CommandServiceImpl.java |
Adds @transactional annotation to ensure atomic error command insertion and command deletion |
WorkflowGraph.java |
Replaces stream-based map creation with explicit loop to add duplicate task name/code validation |
WorkflowInstanceDao.java |
Adds interface method for force updating workflow instance state without origin state check |
WorkflowInstanceDaoImpl.java |
Implements force update method delegating to mapper |
WorkflowInstanceMapper.java |
Adds mapper method signature for force state update |
WorkflowInstanceMapper.xml |
Adds SQL update statement that updates state without checking current state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...heduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/WorkflowInstanceMapper.java
Outdated
Show resolved
Hide resolved
...o/src/main/java/org/apache/dolphinscheduler/dao/repository/impl/WorkflowInstanceDaoImpl.java
Show resolved
Hide resolved
...er/src/main/java/org/apache/dolphinscheduler/server/master/engine/command/CommandEngine.java
Outdated
Show resolved
Hide resolved
...ster/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/WorkflowGraph.java
Show resolved
Hide resolved
7da42ef to
e248fdd
Compare
e248fdd to
6ef9e79
Compare
82533fb
6ef9e79 to
82533fb
Compare
82533fb to
6f87ceb
Compare
|
cf58747 to
a5ae49a
Compare
0022e10 to
88a48b0
Compare
|





Purpose of the pull request
fix #17732
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md