dmvk commented on a change in pull request #17693:
URL: https://github.com/apache/flink/pull/17693#discussion_r745025015
##########
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;
+ });
Review comment:
This one is already completed exceptionally, so we actually need a
handle here. We're basically asserting that it has been completed exceptionally
and checkpoint has been disposed. For the 2nd case we can do what you're
suggesting
--
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]