This is an automated email from the ASF dual-hosted git repository.
nkalmar pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/branch-3.5 by this push:
new 05307d6 ZOOKEEPER-3510: Make 'zkServer.sh stop' more reliable
05307d6 is described below
commit 05307d61a8f472e4b5ce4d5e2cb997ddba2b375e
Author: Damien Diederen <dd@crosstwine.com>
AuthorDate: Fri Aug 23 12:14:46 2019 +0200
ZOOKEEPER-3510: Make 'zkServer.sh stop' more reliable
As mentioned in https://github.com/apache/zookeeper/pull/1054#discussion_r314208678 :
There is a `sleep 3` statement in `zkServer.sh restart`. I am unable to unearth the history
of that particular line, but I believe part—if not all—of that sleep should be part of
`zkServer.sh stop`.
I frequently observe `FAILED TO START` errors in the C test suite; the logs consistently
show that those are caused by `java.net.BindException: Address already in use`. Adding a simple
`sleep 1` before `echo STOPPED` "fixes" it for me.
As noted in the commit message, the `sleep` is far from optimal, an adaptive mechanism
would be better—but I do not want to make the first iteration too complicated.
Author: Damien Diederen <dd@crosstwine.com>
Reviewers: Enrico Olivelli <eolivelli@apache.org>, Norbert Kalmar <nkalmar@apache.org>
Closes #1055 from ztzg/ZOOKEEPER-3510-zkserver-stop-delay
(cherry picked from commit 942213dfe28e464f068f8a195d1424c4b29af585)
Signed-off-by: Norbert Kalmar <nkalmar@apache.org>
---
bin/zkServer.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/bin/zkServer.sh b/bin/zkServer.sh
index e170946..bfeb9ce 100755
--- a/bin/zkServer.sh
+++ b/bin/zkServer.sh
@@ -212,6 +212,7 @@ stop)
else
$KILL $(cat "$ZOOPIDFILE")
rm "$ZOOPIDFILE"
+ sleep 1
echo STOPPED
fi
exit 0
|