Skip to content

Commit

Permalink
Handle CancellationException since it's used in timeouts in BrokerSer…
Browse files Browse the repository at this point in the history
…vice
  • Loading branch information
lhotari committed Apr 13, 2021
1 parent 91d0e0f commit 405c093
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import io.netty.util.concurrent.DefaultThreadFactory;
import java.lang.reflect.Method;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -74,7 +75,7 @@ public void run() {
future.get(service.getConfiguration().getBrokerShutdownTimeoutMs(), TimeUnit.MILLISECONDS);

LOG.info("Completed graceful shutdown. Exiting");
} catch (TimeoutException e) {
} catch (TimeoutException | CancellationException e) {
LOG.warn("Graceful shutdown timeout expired. Closing now");
} catch (Exception e) {
LOG.error("Failed to perform graceful shutdown, Exiting anyway", e);
Expand Down

0 comments on commit 405c093

Please sign in to comment.