IGNITE-27857 Set job status to COMPLETED when job ran to completion#7744
Open
valepakh wants to merge 3 commits intoapache:mainfrom
Open
IGNITE-27857 Set job status to COMPLETED when job ran to completion#7744valepakh wants to merge 3 commits intoapache:mainfrom
valepakh wants to merge 3 commits intoapache:mainfrom
Conversation
ptupitsyn
approved these changes
Mar 10, 2026
There was a problem hiding this comment.
Pull request overview
Updates compute job cancellation semantics so that jobs that finish successfully after a cancel request are marked COMPLETED (cooperative cancellation), while jobs that explicitly signal cancellation (e.g., via CancellationException) are CANCELED.
Changes:
- Treat “cancel requested but job completed normally” as COMPLETED in the compute queue executor.
- Update multiple tests/jobs to throw
CancellationExceptionon interruption when cancellation should be reflected as CANCELED. - Add a new cancel-aware sleep job and extend event/state assertions for cancellation scenarios.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/systemviews/ItComputeSystemViewTest.java | Adjusts interruption handling in a long-running test job to throw CancellationException. |
| modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java | Updates interrupt handling to map interruption to CancellationException for cancellation tests. |
| modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/compute/ItComputeControllerTest.java | Aligns REST compute cancellation behavior with cancel-aware interruption semantics. |
| modules/compute/src/test/java/org/apache/ignite/internal/compute/queue/PriorityQueueExecutorTest.java | Updates queue executor tests to treat interruption as cancellation via CancellationException. |
| modules/compute/src/test/java/org/apache/ignite/internal/compute/executor/ComputeExecutorTest.java | Updates expected job status to COMPLETED for cooperative cancellation; adds cancel-aware cancellation test. |
| modules/compute/src/test/java/org/apache/ignite/internal/compute/ComputeComponentImplTest.java | Updates expectation to COMPLETED when job completes normally after cancel request. |
| modules/compute/src/main/java/org/apache/ignite/internal/compute/queue/QueueExecutionImpl.java | Changes completion logic to always mark normally-finished jobs as COMPLETED even if cancellation was requested. |
| modules/compute/src/jobs/java/org/example/jobs/standalone/CancelAwareSleepJob.java | Adds a standalone cancel-aware sleep job used for cancellation scenarios. |
| modules/compute/src/integrationTest/java/org/example/jobs/embedded/CancelAwareSleepJob.java | Adds an embedded cancel-aware sleep job used in integration tests. |
| modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/events/ItComputeEventsTest.java | Extends event assertions for cooperative vs cancel-aware cancellation; adds a cancel-aware job test. |
| modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeBaseTest.java | Switches cancellation tests to use the cancel-aware sleep job and updates expected outcomes. |
Comments suppressed due to low confidence (1)
modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeBaseTest.java:1
- The test name
cancelsNotCancellableJobno longer matches the asserted behavior (job completes normally withCOMPLETED). Rename the test to reflect cooperative cancellation semantics (e.g.,cancelRequestedButJobCompletesNormally), or adjust assertions if the intent is still to validate a non-cancellable/canceled outcome.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
modules/compute/src/jobs/java/org/example/jobs/standalone/CancelAwareSleepJob.java
Show resolved
Hide resolved
modules/compute/src/integrationTest/java/org/example/jobs/embedded/CancelAwareSleepJob.java
Show resolved
Hide resolved
...s/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeBaseTest.java
Show resolved
Hide resolved
...s/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeBaseTest.java
Show resolved
Hide resolved
...s/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeBaseTest.java
Show resolved
Hide resolved
...s/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeBaseTest.java
Show resolved
Hide resolved
...ompute/src/test/java/org/apache/ignite/internal/compute/queue/PriorityQueueExecutorTest.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/IGNITE-27857