Skip to content

Commit

Permalink
[FLINK-21735][coordination] Harden JobMaster#updateTaskExecutionState()
Browse files Browse the repository at this point in the history
This closes apache#15196.
  • Loading branch information
SteNicholas authored and tillrohrmann committed Mar 15, 2021
1 parent c1aa6b4 commit 4751f2e
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,26 @@ public CompletableFuture<Acknowledge> cancel(Time timeout) {
@Override
public CompletableFuture<Acknowledge> updateTaskExecutionState(
final TaskExecutionState taskExecutionState) {
checkNotNull(taskExecutionState, "taskExecutionState");
FlinkException taskExecutionException;
try {
checkNotNull(taskExecutionState, "taskExecutionState");

if (schedulerNG.updateTaskExecutionState(taskExecutionState)) {
return CompletableFuture.completedFuture(Acknowledge.get());
} else {
return FutureUtils.completedExceptionally(
new ExecutionGraphException(
"The execution attempt "
+ taskExecutionState.getID()
+ " was not found."));
if (schedulerNG.updateTaskExecutionState(taskExecutionState)) {
return CompletableFuture.completedFuture(Acknowledge.get());
} else {
taskExecutionException =
new ExecutionGraphException(
"The execution attempt "
+ taskExecutionState.getID()
+ " was not found.");
}
} catch (Exception e) {
taskExecutionException =
new JobMasterException(
"Could not update the state of task execution for JobMaster.", e);
handleJobMasterError(taskExecutionException);
}
return FutureUtils.completedExceptionally(taskExecutionException);
}

@Override
Expand Down

0 comments on commit 4751f2e

Please sign in to comment.