tillrohrmann commented on a change in pull request #7568: [FLINK-11417] Make
access to ExecutionGraph single threaded from JobMaster main thread
URL: https://github.com/apache/flink/pull/7568#discussion_r253422204
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/RestartIndividualStrategy.java
##########
@@ -108,25 +92,28 @@ public void onTaskFailure(Execution taskExecution,
Throwable cause) {
// it helps to support better testing
final CompletableFuture<ExecutionState> terminationFuture =
taskExecution.getTerminalStateFuture();
- final ExecutionVertex vertexToRecover =
taskExecution.getVertex();
- final long globalModVersion =
taskExecution.getGlobalModVersion();
-
- terminationFuture.thenAcceptAsync(
- (ExecutionState value) -> {
- try {
- long createTimestamp =
System.currentTimeMillis();
- Execution newExecution =
vertexToRecover.resetForNewExecution(createTimestamp, globalModVersion);
- newExecution.scheduleForExecution();
- }
- catch (GlobalModVersionMismatch e) {
- // this happens if a concurrent global
recovery happens. simply do nothing.
- }
- catch (Exception e) {
- executionGraph.failGlobal(
- new Exception("Error
during fine grained recovery - triggering full recovery", e));
- }
- },
- callbackExecutor);
+ Consumer<ExecutionState> restartProcedure = (ExecutionState
executionState) -> {
+ performExecutionVertexRestart(
+ taskExecution.getVertex(),
+ taskExecution.getGlobalModVersion());
+ };
+
+ terminationFuture.thenAccept(restartProcedure);
Review comment:
nit: this could be `terminationFuture.thenRun(() ->
performExecutionVertexRestart(taskExecution.getVertex(),
taskExecution.getGlobalModVersion()))` and then we would not need to create the
`restartProcedure` consumer.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services