dmvk commented on a change in pull request #17693:
URL: https://github.com/apache/flink/pull/17693#discussion_r745441379



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/PendingCheckpointTest.java
##########
@@ -578,6 +580,55 @@ public void testReportTaskFinishedOperators() throws 
IOException {
                 contains(ACK_TASKS.get(0).getVertex()));
     }
 
+    /**
+     * We need to trigger disposal prior completing the checkpoint future to 
avoid a race condition
+     * with the CheckpointCleaner shutdown.
+     */
+    @Test
+    public void testAbortTriggersDisposalPriorCompletingCheckpointFuture() 
throws Exception {
+        final PendingCheckpoint pending =
+                createPendingCheckpoint(
+                        CheckpointProperties.forCheckpoint(
+                                
CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION));
+        final CompletableFuture<Void> completionFuture =
+                pending.getCompletionFuture()
+                        .handle(
+                                (result, error) -> {
+                                    assertNull(result);
+                                    assertNotNull(error);
+                                    assertTrue(pending.isDisposed());
+                                    return null;
+                                });
+        abort(pending, CheckpointFailureReason.CHECKPOINT_DECLINED);
+        completionFuture.get();
+    }
+
+    /**
+     * We need to trigger disposal prior completing the checkpoint future to 
avoid a race condition
+     * with the CheckpointCleaner shutdown.

Review comment:
       👍 




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