Skip to content

Conversation

@ruanwenjun
Copy link
Member

@ruanwenjun ruanwenjun commented Nov 27, 2025

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

Copy link
Contributor

Copilot AI left a 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.

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_changeWorkflowInstanceStateToFailure branch from 7da42ef to e248fdd Compare November 27, 2025 12:25
@github-actions github-actions bot added the test label Nov 27, 2025
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_changeWorkflowInstanceStateToFailure branch from e248fdd to 6ef9e79 Compare November 27, 2025 12:31
zhongjiajie
zhongjiajie previously approved these changes Nov 27, 2025
SbloodyS
SbloodyS previously approved these changes Nov 27, 2025
@ruanwenjun ruanwenjun dismissed stale reviews from SbloodyS and zhongjiajie via 82533fb November 27, 2025 15:06
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_changeWorkflowInstanceStateToFailure branch from 6ef9e79 to 82533fb Compare November 27, 2025 15:06
SbloodyS
SbloodyS previously approved these changes Nov 28, 2025
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_changeWorkflowInstanceStateToFailure branch from 82533fb to 6f87ceb Compare November 28, 2025 07:27
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
43.8% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_changeWorkflowInstanceStateToFailure branch 3 times, most recently from cf58747 to a5ae49a Compare November 29, 2025 07:40
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_changeWorkflowInstanceStateToFailure branch from 0022e10 to 88a48b0 Compare December 1, 2025 11:45
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2025

@SbloodyS SbloodyS merged commit e119b1d into apache:dev Dec 3, 2025
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Task hanged in submitted

3 participants