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:51:31 UTC
[pulsar] branch branch-2.10 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-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.10 by this push:
new 9e47fa6fd65 [improve] [broker] Fix broker restart logic (#20113)
9e47fa6fd65 is described below
commit 9e47fa6fd651f7cff58baf6ed3525843a49e4f0f
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 d1c01d93f78..4d689e124c9 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
@@ -452,6 +452,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();
@@ -486,12 +492,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;