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


##########
runtime/src/main/java/org/apache/flink/agents/runtime/context/JavaRunnerContextImpl.java:
##########
@@ -75,35 +76,89 @@ protected <T> T resolveDurableAsync(DurableCallable<T> 
callable) throws Exceptio
                 return durableExecuteAsyncWithReconcile(callable, 
reconcileCallable);
             }
         }
-        return durableExecuteCompletionOnly(callable, () -> 
executeAsyncCallable(callable));
+        return durableExecuteCompletionOnly(callable, () -> 
resolveAsync(callable::call));
     }
 
     private <T> T durableExecuteAsyncWithReconcile(
             DurableCallable<T> callable, Callable<T> reconcileCallable) throws 
Exception {
         return durableExecuteWithReconcile(
-                callable, reconcileCallable, () -> 
executeAsyncCallable(callable));
+                callable, reconcileCallable, () -> 
resolveAsync(callable::call));
     }
 
     @Override
-    protected <T> List<Outcome<T>> 
resolveDurableBatch(List<DurableCallable<T>> callables)
+    protected <T> List<Outcome<T>> 
resolveAsyncBatch(List<SingleAsyncFuture<T>> futures)
             throws Exception {
-        if (callables.isEmpty()) {
-            return List.of();
+        List<DurableCallable<T>> durableCalls = new ArrayList<>();
+        for (SingleAsyncFuture<T> future : futures) {
+            if (future.getDurableCallable() != null) {
+                durableCalls.add(future.getDurableCallable());
+            }
         }
-        if (durableExecutionContext == null) {
-            return executeAllWithoutDurableState(callables);
+        if (durableExecutionContext == null || durableCalls.isEmpty()) {
+            List<Callable<T>> suppliers = new ArrayList<>();
+            for (SingleAsyncFuture<T> future : futures) {
+                suppliers.add(future.getCallable());
+            }
+            return executeAllWithoutDurableState(suppliers);

Review Comment:
   Thanks for catching this. Fixed in 
[df726bde8](https://github.com/apache/flink-agents/commit/df726bde848d5d4068f774b4cecd77bbb7e83923):
 both JDK 21 batch collectors now unwrap the CompletionException and rethrow 
the original Error, so it cannot be swallowed by catch (Exception) or cached as 
a business exception. Added packaged multi-release JDK 21 regressions for 
normal and timeout collection, with ordinary-exception controls; all four pass.



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