ptupitsyn commented on code in PR #3930:
URL: https://github.com/apache/ignite-3/pull/3930#discussion_r1644239217


##########
modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/utils/InteractiveTasks.java:
##########
@@ -174,6 +196,11 @@ public List<MapReduceJob> split(TaskExecutionContext 
context, Object... args) {
                                             .nodes(Set.of(node))
                                             .build()
                             ).collect(toList());
+                        case CHECK_CANCEL:
+                            if (context.isCancelled()) {
+                                throw new RuntimeException();

Review Comment:
   Please provide an exception message.



##########
modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/utils/InteractiveTasks.java:
##########
@@ -199,6 +226,11 @@ public List<String> reduce(Map<UUID, ?> results) {
                             return results.values().stream()
                                     .map(String.class::cast)
                                     .collect(toList());
+                        case CHECK_CANCEL:
+                            if (context.isCancelled()) {
+                                throw new RuntimeException();

Review Comment:
   Please provide an exception message.



##########
modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/utils/InteractiveTasks.java:
##########
@@ -67,9 +67,9 @@ public final class InteractiveTasks {
     private static final AtomicInteger RUNNING_GLOBAL_SPLIT_CNT = new 
AtomicInteger(0);
 
     /**
-     * This counter indicated how many {@link 
GlobalInteractiveMapReduceTask#reduce(Map)} methods are running now. This 
counter increased
-     * each time the {@link GlobalInteractiveMapReduceTask#reduce(Map)} is 
called and decreased when the method is finished (whatever the
-     * result is). Checked in {@link #clearState}.
+     * This counter indicated how many {@link 
GlobalInteractiveMapReduceTask#reduce(TaskExecutionContext, Map)} methods are 
running now.
+     * This counter increased each time the {@link 
GlobalInteractiveMapReduceTask#reduce(TaskExecutionContext, Map)} is called and 
decreased
+     * when the method is finished (whatever the result is). Checked in {@link 
#clearState}.

Review Comment:
   ```suggestion
        * This counter indicates how many {@link 
GlobalInteractiveMapReduceTask#reduce(TaskExecutionContext, Map)} methods are 
running now.
        * This counter is increased every time the {@link 
GlobalInteractiveMapReduceTask#reduce(TaskExecutionContext, Map)} is called and 
decreased
        * when the method is finished (whatever the result is). Checked in 
{@link #clearState}.
   ```



##########
modules/compute/src/main/java/org/apache/ignite/internal/compute/task/TaskExecutionInternal.java:
##########
@@ -184,8 +191,12 @@ public CompletableFuture<R> resultAsync() {
 
     @Override
     public CompletableFuture<@Nullable Boolean> cancelAsync() {
+        isCancelled.set(true);

Review Comment:
   What if it is already cancelled, should we exit early with `false`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to