You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2023/04/18 01:49:58 UTC

[pulsar] branch branch-3.0 updated: [improve] [broker] Fix broker restart logic (#20113)

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

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


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

commit a92defcc88d2d80e6d75a5425eb5f734fe0a5f68
Author: xiaolong ran <xi...@tencent.com>
AuthorDate: Tue Apr 18 09:45:19 2023 +0800

    [improve] [broker] Fix broker restart logic (#20113)
    
    (cherry picked from commit 092819b5c4a68dbc39d9a650d5370af9455e805d)
---
 .../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;