This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 092819b5c4a [improve] [broker] Fix broker restart logic (#20113)
092819b5c4a is described below

commit 092819b5c4a68dbc39d9a650d5370af9455e805d
Author: xiaolong ran <[email protected]>
AuthorDate: Tue Apr 18 09:45:19 2023 +0800

    [improve] [broker] Fix broker restart logic (#20113)
---
 .../main/java/org/apache/pulsar/broker/PulsarService.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
index aad7d32f732..5fc9920d0f2 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
@@ -467,6 +467,12 @@ public class PulsarService implements AutoCloseable, 
ShutdownService {
                 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();
@@ -501,12 +507,6 @@ public class PulsarService implements AutoCloseable, 
ShutdownService {
                 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;

Reply via email to