Skip to content

Commit

Permalink
Review: ensure executor shutdown in error case.
Browse files Browse the repository at this point in the history
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
  • Loading branch information
yufei-cai committed Oct 26, 2021
1 parent ea6b4b1 commit dc980ef
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void request(final long n) {
public void cancel() {
if (!singleThreadedExecutorService.isShutdown() && !singleThreadedExecutorService.isTerminated()) {
CompletableFuture.runAsync(this::doCancel, singleThreadedExecutorService)
.thenAccept(unused -> singleThreadedExecutorService.shutdownNow());
.whenComplete((result, error) -> singleThreadedExecutorService.shutdownNow());
}
}

Expand Down

0 comments on commit dc980ef

Please sign in to comment.