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 2019/07/04 06:55:04 UTC

[GitHub] [flink] GJL commented on a change in pull request #8972: [FLINK-13060][coordination] Respect restart constraints in new RegionFailover strategy

GJL commented on a change in pull request #8972: [FLINK-13060][coordination] Respect restart constraints in new RegionFailover strategy
URL: https://github.com/apache/flink/pull/8972#discussion_r300247346
 
 

 ##########
 File path: flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/AdaptedRestartPipelinedRegionStrategyNGFailoverTest.java
 ##########
 @@ -248,6 +253,45 @@ public void testNoRestart() throws Exception {
 		assertEquals(JobStatus.FAILED, eg.getState());
 	}
 
+	/**
+	 * Tests that the execution of the restart logic of the failover strategy is dependent on the restart strategy
+	 * calling {@link RestartCallback#triggerFullRecovery()}.
+	 */
+	@Test
+	public void testFailoverExecutionDependentOnRestartStrategyRecoveryTrigger() throws Exception {
+		final JobGraph jobGraph = createBatchJobGraph();
+		final CompletableFuture<Void> restartCallFuture = new CompletableFuture<>();
+		final RestartStrategy restartStrategy = new RestartStrategy() {
+			@Override
+			public boolean canRestart() {
+				return true;
+			}
+
+			@Override
+			public void restart(RestartCallback restarter, ScheduledExecutor executor) {
+				restartCallFuture.complete(null);
+			}
+		};
+		final ExecutionGraph eg = createExecutionGraph(jobGraph, restartStrategy);
+
+		final ExecutionVertex ev = eg.getAllExecutionVertices().iterator().next();
+
+		ev.fail(new Exception("Test Exception"));
+
+		manualMainThreadExecutor.triggerAll();
+
+		// the entire failover-procedure is being halted by the restart strategy not doing anything
+		// the only thing the failover strategy should do is cancel tasks that require it
+
+		// sanity check to ensure we actually called into the restart strategy
+		assertEquals(restartCallFuture.isDone(),true);
 
 Review comment:
   I think we use `restartCallFuture` as a `CountDownLatch` or `AtomicInteger` here. See my other comment at the beginning of this test.

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