This is an automated email from the ASF dual-hosted git repository.

apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 5960d6a81b1 IGNITE-25640 Fix cancelled compute task status (#6492)
5960d6a81b1 is described below

commit 5960d6a81b1e167c72201f9a4f4e8493e0367b53
Author: Vadim Pakhnushev <[email protected]>
AuthorDate: Wed Aug 27 12:10:36 2025 +0300

    IGNITE-25640 Fix cancelled compute task status (#6492)
---
 .../java/org/apache/ignite/internal/compute/ItMapReduceTest.java       | 2 +-
 .../org/apache/ignite/internal/compute/task/TaskExecutionInternal.java | 3 +--
 modules/platforms/dotnet/Apache.Ignite.Tests/Compute/ComputeTests.cs   | 3 +--
 .../ignite/internal/runner/app/client/ItThinClientComputeTest.java     | 2 --
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git 
a/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItMapReduceTest.java
 
b/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItMapReduceTest.java
index 8c4634ffdd0..dafcdef6771 100644
--- 
a/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItMapReduceTest.java
+++ 
b/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItMapReduceTest.java
@@ -197,7 +197,7 @@ class ItMapReduceTest extends 
ClusterPerClassIntegrationTest {
         assertThat(cancelHandle.cancelAsync(), willCompleteSuccessfully());
 
         // Then the task is cancelled.
-        assertTaskFailed(taskExecution, FAILED, stateBeforeSplit);
+        assertTaskFailed(taskExecution, CANCELED, stateBeforeSplit);
 
         // And states list contains canceled states.
         assertJobStates(taskExecution, JobStatus.CANCELED);
diff --git 
a/modules/compute/src/main/java/org/apache/ignite/internal/compute/task/TaskExecutionInternal.java
 
b/modules/compute/src/main/java/org/apache/ignite/internal/compute/task/TaskExecutionInternal.java
index 6e4c8d7b350..f1b4c8558ae 100644
--- 
a/modules/compute/src/main/java/org/apache/ignite/internal/compute/task/TaskExecutionInternal.java
+++ 
b/modules/compute/src/main/java/org/apache/ignite/internal/compute/task/TaskExecutionInternal.java
@@ -41,7 +41,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.UUID;
-import java.util.concurrent.CancellationException;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
@@ -157,7 +156,7 @@ public class TaskExecutionInternal<I, M, T, R> implements 
CancellableTaskExecuti
     private void captureReduceFailure(QueueExecution<R> reduceExecution, 
Throwable throwable) {
         if (throwable != null) {
             // Capture the reduce execution failure reason and time.
-            TaskStatus status = throwable instanceof CancellationException ? 
CANCELED : FAILED;
+            TaskStatus status = isCancelled.get() ? CANCELED : FAILED;
 
             JobState state = splitExecution.state();
             if (state != null) {
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Tests/Compute/ComputeTests.cs 
b/modules/platforms/dotnet/Apache.Ignite.Tests/Compute/ComputeTests.cs
index 87b36746fde..0f9bf019b98 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/Compute/ComputeTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Compute/ComputeTests.cs
@@ -744,8 +744,7 @@ namespace Apache.Ignite.Tests.Compute
 
             TaskState? state = await taskExec.GetStateAsync();
 
-            // TODO IGNITE-25640: must be TaskStatus.Canceled.
-            Assert.AreEqual(TaskStatus.Failed, state?.Status);
+            Assert.AreEqual(TaskStatus.Canceled, state?.Status);
         }
 
         [Test]
diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java
index 40fdd4e04f1..81f65b3de8a 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java
@@ -108,7 +108,6 @@ import org.apache.ignite.table.mapper.Mapper;
 import org.hamcrest.Matcher;
 import org.hamcrest.Matchers;
 import org.jetbrains.annotations.Nullable;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.CsvSource;
@@ -228,7 +227,6 @@ public class ItThinClientComputeTest extends 
ItAbstractThinClientTest {
     }
 
     @Test
-    @Disabled("IGNITE-25640")
     void cancelComputeSubmitMapReduceAsyncWithCancelHandle() {
         IgniteClient entryNode = client();
 

Reply via email to