wenjin272 commented on code in PR #1208:
URL: https://github.com/apache/flink-agents/pull/1208#discussion_r4236800356


##########
runtime/src/main/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImpl.java:
##########
@@ -222,25 +277,22 @@ private BatchExecutionPlan(int size) {
         }
     }
 
-    private <T> List<Outcome<T>> 
executeAllWithoutDurableState(List<DurableCallable<T>> callables)
+    private <T> List<Outcome<T>> 
executeAllWithoutDurableState(List<Callable<T>> suppliers)
             throws Exception {
-        List<Callable<T>> suppliers = new ArrayList<>();
-        for (DurableCallable<T> callable : callables) {
-            suppliers.add(callable::call);
-        }
         List<Outcome<T>> outcomes = 
executeOutcomeSuppliers(suppliers).getOutcomes();
         for (Outcome<T> outcome : outcomes) {
-            if (outcome.isFailure() && outcome.getError() instanceof 
InterruptedException) {
-                // Without a durable store there is nothing to leave pending, 
but a cancellation
-                // signal folded into a failed Outcome must still propagate as 
an interruption
-                // instead of being handed to the caller as an ordinary tool 
failure.
-                Thread.currentThread().interrupt();
-                throw (InterruptedException) outcome.getError();
-            }
+            rethrowInterruption(outcome);
         }
         return outcomes;
     }
 
+    private static void rethrowInterruption(Outcome<?> outcome) throws 
InterruptedException {

Review Comment:
   Thanks, agreed. Fixed in 
[df726bde8](https://github.com/apache/flink-agents/commit/df726bde848d5d4068f774b4cecd77bbb7e83923)
 with a shared CancellationUtils classifier used by async handles, 
batch/durable finalization, routing and tool paths. It follows the cause chain 
for InterruptedException, ClosedByInterruptException and CancellationException, 
while excluding bare InterruptedIOException and network timeouts. Cancellation 
propagates without terminal caching or persistence as a business failure; only 
actual interruption restores the interrupt flag. Added direct, NIO and 
wrapped-signal regressions, including durable-state checks and packaged 
executor tests on JDK 17 and 21.



-- 
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