Skip to content

Commit

Permalink
[Improve] Fix broker restart logic
Browse files Browse the repository at this point in the history
Signed-off-by: xiaolongran <[email protected]>
  • Loading branch information
wolfstudy committed Apr 17, 2023
1 parent b7eab94 commit 5a4dff4
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ public CompletableFuture<Void> closeAsync() {
protocolHandlers = null;
}

// cancel loadShedding task and shutdown the loadManager executor before shutting down the broker
if (this.loadSheddingTask != null) {
this.loadSheddingTask.cancel();
}
executorServicesShutdown.shutdown(loadManagerExecutor);

List<CompletableFuture<Void>> asyncCloseFutures = new ArrayList<>();
if (this.brokerService != null) {
CompletableFuture<Void> brokerCloseFuture = this.brokerService.closeAsync();
Expand Down Expand Up @@ -501,12 +507,6 @@ public CompletableFuture<Void> closeAsync() {
this.leaderElectionService = null;
}

// cancel loadShedding task and shutdown the loadManager executor before shutting down the broker
if (this.loadSheddingTask != null) {
this.loadSheddingTask.cancel();
}
executorServicesShutdown.shutdown(loadManagerExecutor);

if (adminClient != null) {
adminClient.close();
adminClient = null;
Expand Down

0 comments on commit 5a4dff4

Please sign in to comment.