Skip to content

Commit

Permalink
1. rename client highPriorityTaskExecutor (#4496)
Browse files Browse the repository at this point in the history
2. shutdownNow when not shutdown cleanly
  • Loading branch information
wenbingshen committed Sep 2, 2024
1 parent 2bcf41c commit 42407f7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public BookKeeper(ClientConfiguration conf, ZooKeeper zk, EventLoopGroup eventLo
// initialize resources
this.scheduler = OrderedScheduler.newSchedulerBuilder().numThreads(1).name("BookKeeperClientScheduler").build();
this.highPriorityTaskExecutor =
OrderedScheduler.newSchedulerBuilder().numThreads(1).name("BookKeeperWatchTaskScheduler").build();
OrderedScheduler.newSchedulerBuilder().numThreads(1).name("BookKeeperHighPriorityThread").build();
this.mainWorkerPool = OrderedExecutor.newBuilder()
.name("BookKeeperClientWorker")
.numThreads(conf.getNumWorkerThreads())
Expand Down Expand Up @@ -1472,7 +1472,8 @@ public void close() throws BKException, InterruptedException {
// Close the watchTask scheduler
highPriorityTaskExecutor.shutdown();
if (!highPriorityTaskExecutor.awaitTermination(10, TimeUnit.SECONDS)) {
LOG.warn("The highPriorityTaskExecutor for WatchTask did not shutdown cleanly");
LOG.warn("The highPriorityTaskExecutor for WatchTask did not shutdown cleanly, interrupting");
highPriorityTaskExecutor.shutdownNow();
}

mainWorkerPool.shutdown();
Expand Down

0 comments on commit 42407f7

Please sign in to comment.