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


##########
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:
   You are right, CompletableFuture#isCompletedExceptionally() can be used. 
Thanks for the reminder, I will update the pr.



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