Skip to content

Commit

Permalink
[FLINK-14434][coordination] Dispatcher#createJobManagerRunner returns…
Browse files Browse the repository at this point in the history
… on creation succeed

This closes apache#9940.
  • Loading branch information
tisonkun authored and tillrohrmann committed Oct 21, 2019
1 parent c9002d2 commit 9add2b1
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -333,6 +333,7 @@ private CompletableFuture<Void> runJob(JobGraph jobGraph) {
jobManagerRunnerFutures.put(jobGraph.getJobID(), jobManagerRunnerFuture);

return jobManagerRunnerFuture
.thenApply(FunctionUtils.uncheckedFunction(this::startJobManagerRunner))
.thenApply(FunctionUtils.nullFn())
.whenCompleteAsync(
(ignored, throwable) -> {
Expand All @@ -346,7 +347,7 @@ private CompletableFuture<Void> runJob(JobGraph jobGraph) {
private CompletableFuture<JobManagerRunner> createJobManagerRunner(JobGraph jobGraph) {
final RpcService rpcService = getRpcService();

final CompletableFuture<JobManagerRunner> jobManagerRunnerFuture = CompletableFuture.supplyAsync(
return CompletableFuture.supplyAsync(
CheckedSupplier.unchecked(() ->
jobManagerRunnerFactory.createJobManagerRunner(
jobGraph,
Expand All @@ -358,8 +359,6 @@ private CompletableFuture<JobManagerRunner> createJobManagerRunner(JobGraph jobG
new DefaultJobManagerJobMetricGroupFactory(jobManagerMetricGroup),
fatalErrorHandler)),
rpcService.getExecutor());

return jobManagerRunnerFuture.thenApply(FunctionUtils.uncheckedFunction(this::startJobManagerRunner));
}

private JobManagerRunner startJobManagerRunner(JobManagerRunner jobManagerRunner) throws Exception {
Expand Down

0 comments on commit 9add2b1

Please sign in to comment.