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


##########
flink-core/src/main/java/org/apache/flink/core/state/StateFutureImpl.java:
##########
@@ -226,10 +228,19 @@ public <A> StateFutureImpl<A> makeNewStateFuture() {
 
     @Override
     public void complete(T result) {
+        if (failed) {
+            throw new IllegalStateException("StateFuture already failed !");
+        }
         completableFuture.complete(result);
         postComplete(false);
     }
 
+    @Override
+    public void completeExceptionally(String message, Throwable ex) {
+        failed = true;
+        exceptionHandler.handleException(message, ex);

Review Comment:
   IIUC, calling `completableFuture.completeExceptionally(ex)` is enough? We 
don't need to maintain `failed` by ourselves?



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