From 789cb10623c5ed1e730aef66ca5e79c877e74bb7 Mon Sep 17 00:00:00 2001 From: Michael Han Date: Fri, 4 Sep 2020 13:46:02 -0700 Subject: [PATCH] notify when switch from initial to serving state. --- .../java/org/apache/zookeeper/server/ZooKeeperServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java index e8ecf431881..56edc0284d0 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java @@ -663,16 +663,15 @@ public void startdata() throws IOException, InterruptedException { public synchronized void startup() { startupWithServerState(State.RUNNING); - notifyAll(); } public synchronized void startupWithoutServing() { startupWithServerState(State.INITIAL); - notifyAll(); } public synchronized void startServing() { setState(State.RUNNING); + notifyAll(); } private void startupWithServerState(State state) { @@ -695,6 +694,8 @@ private void startupWithServerState(State state) { requestPathMetricsCollector.start(); localSessionEnabled = sessionTracker.isLocalSessionsEnabled(); + + notifyAll(); } protected void startJvmPauseMonitor() {