You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/07 13:38:56 UTC
[GitHub] [flink] pnowojski commented on a change in pull request #11648: [FLINK-16945][checkpointing] Execute CheckpointFailureManager.FailJob…
pnowojski commented on a change in pull request #11648: [FLINK-16945][checkpointing] Execute CheckpointFailureManager.FailJob…
URL: https://github.com/apache/flink/pull/11648#discussion_r404800327
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/ExecutionGraphCheckpointCoordinatorTest.java
##########
@@ -131,9 +142,82 @@ public void testShutdownCheckpointCoordinatorOnFinished() throws Exception {
assertThat(storeShutdownFuture.get(), is(JobStatus.FINISHED));
}
+ /**
+ * The case is designed to check the race condition between {@link ExecutionGraph} and
+ * {@link CheckpointCoordinator}. There should be no checkpoint accepted after
+ * {@link CheckpointFailureManager} decides to fail the {@link ExecutionGraph}.
+ */
+ @Test
+ public void testNoCheckpointAcceptedWhileFailingExecutionGraph() throws Exception {
+ CheckpointIDCounter counter = new TestingCheckpointIDCounter(new CompletableFuture<>());
+
+ TestingCompletedCheckpointStore store = new TestingCompletedCheckpointStore(new CompletableFuture<>());
+
+ final ManuallyTriggeredScheduledExecutor mainThreadExecutor = new ManuallyTriggeredScheduledExecutor();
+ ExecutionGraph graph = createExecutionGraphAndEnableCheckpointing(
+ counter,
+ store,
+ new ComponentMainThreadExecutorServiceAdapter(mainThreadExecutor, Thread.currentThread()));
+
+ final CheckpointCoordinator checkpointCoordinator = graph.getCheckpointCoordinator();
+
+ assertThat(checkpointCoordinator, Matchers.notNullValue());
+ assertThat(checkpointCoordinator.isShutdown(), is(false));
+
+ graph.scheduleForExecution();
+ ExecutionGraphTestUtils.switchToRunning(graph);
+
+ // trigger a normal checkpoint which would be declined then
+ checkpointCoordinator.triggerCheckpoint(System.currentTimeMillis(), true);
+ mainThreadExecutor.triggerAll();
+ final long checkpointId = checkpointCoordinator.getPendingCheckpoints().keySet().iterator().next();
Review comment:
~Why is this checkpoint going to be declined? Maybe expand the comment with a bit of explanation?~
~If it's failing, maybe add an assertion that it has failed? Or just skip this code block if it's not necessary for the test as a whole?~
edit:
replace
```
// trigger a normal checkpoint which would be declined then
```
with
```
// trigger a normal checkpoint which we will fail/decline later
```
to avoid confusion as mine above? :)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services