Skip to content

Commit

Permalink
[FLINK-8049] [rest] REST client reports netty exceptions on shutdown.
Browse files Browse the repository at this point in the history
This closes apache#5057.
  • Loading branch information
kl0u committed Jan 16, 2018
1 parent 642e11a commit 7da32d1
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,14 @@ public void shutdown(Time timeout) {
CompletableFuture<?> groupFuture = new CompletableFuture<>();
if (bootstrap != null) {
if (bootstrap.group() != null) {
bootstrap.group().shutdownGracefully(0, timeout.toMilliseconds(), TimeUnit.MILLISECONDS)
.addListener(ignored -> groupFuture.complete(null));
bootstrap.group().shutdownGracefully(0L, timeout.toMilliseconds(), TimeUnit.MILLISECONDS)
.addListener(finished -> {
if (finished.isSuccess()) {
groupFuture.complete(null);
} else {
groupFuture.completeExceptionally(finished.cause());
}
});
}
}

Expand Down

0 comments on commit 7da32d1

Please sign in to comment.