Skip to content

IGNITE-23769 Compute job cancel race#5095

Merged
Pochatkin merged 4 commits intoapache:mainfrom
unisonteam:IGNITE-23769
Jan 24, 2025
Merged

IGNITE-23769 Compute job cancel race#5095
Pochatkin merged 4 commits intoapache:mainfrom
unisonteam:IGNITE-23769

Conversation

@valepakh
Copy link
Copy Markdown
Contributor

@valepakh valepakh commented Jan 22, 2025

https://issues.apache.org/jira/browse/IGNITE-23769

This fixes the specific race when job status was QUEUED at the time of stateMachine.cancelingJob call but the job was already removed from the work queue.
In this case cancelingJob will change the status to CANCELED but the stateMachine.executeJob will still be called causing the IllegalJobStatusTransition exception.
To fix this, make both calls under the lock and check the state before transition. In case this state is detected, don't transition the status and don't run the job, return null from the job and check this state again at the final step, completing the result future with the CancellationException.

@Pochatkin Pochatkin merged commit 044313d into apache:main Jan 24, 2025
@valepakh valepakh deleted the IGNITE-23769 branch January 24, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants