Skip to content

Commit

Permalink
[improve] [broker] Fix broker restart logic (#20113)
Browse files Browse the repository at this point in the history
(cherry picked from commit 092819b)
  • Loading branch information
wolfstudy authored and codelipenghui committed Apr 18, 2023
1 parent d058712 commit a92defc
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 a92defc

Please sign in to comment.