Skip to content

Commit

Permalink
[fix][broker]optimize the shutdown sequence of broker service when it…
Browse files Browse the repository at this point in the history
… close (apache#16756)
  • Loading branch information
HQebupt authored Aug 19, 2022
1 parent dcf3059 commit 14912a6
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,11 @@ public CompletableFuture<Void> closeAsync() {
(long) (GRACEFUL_SHUTDOWN_TIMEOUT_RATIO_OF_TOTAL_TIMEOUT
* getConfiguration()
.getBrokerShutdownTimeoutMs())));

// close protocol handler before closing broker service
if (protocolHandlers != null) {
protocolHandlers.close();
protocolHandlers = null;
}

List<CompletableFuture<Void>> asyncCloseFutures = new ArrayList<>();
if (this.brokerService != null) {
Expand Down Expand Up @@ -528,11 +532,6 @@ public CompletableFuture<Void> closeAsync() {

offloadersCache.close();

if (protocolHandlers != null) {
protocolHandlers.close();
protocolHandlers = null;
}

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

0 comments on commit 14912a6

Please sign in to comment.