Zakelly commented on code in PR #24698:
URL: https://github.com/apache/flink/pull/24698#discussion_r1577723817


##########
flink-core/src/main/java/org/apache/flink/core/state/StateFutureImpl.java:
##########
@@ -61,23 +66,34 @@ public <U> StateFuture<U> thenApply(Function<? super T, ? 
extends U> fn) {
                 return StateFutureUtils.completedFuture(r);
             } else {
                 StateFutureImpl<U> ret = makeNewStateFuture();
-                completableFuture.thenAccept(
-                        (t) -> {
-                            callbackRunner.submit(
-                                    () -> {
-                                        ret.complete(fn.apply(t));
-                                        callbackFinished();
-                                    });
-                        });
+                completableFuture
+                        .thenAccept(
+                                (t) -> {
+                                    callbackRunner.submit(
+                                            () -> {
+                                                ret.complete(fn.apply(t));
+                                                callbackFinished();
+                                            });
+                                })
+                        .exceptionally(

Review Comment:
   Shall we do the `exceptionally` here? IIUC, we won't call 
`completeExceptionally` right?
   I was thinking the callback should be protected by:
   ```
   completableFuture
                           .thenAccept(
                                   (t) -> {
                                       try {
                                           callbackRunner.submit(
                                                   () -> {
                                                       
ret.complete(fn.apply(t));
                                                       callbackFinished();
                                                   });
                                         } catch (Throwable e) { 
exceptionHandler.handleException }
                                   })
   ```
   Right?



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to