diff options
author | Damien Diederen <dd@crosstwine.com> | 2019-08-23 12:14:46 +0200 |
---|---|---|
committer | Norbert Kalmar <nkalmar@apache.org> | 2019-08-23 12:14:46 +0200 |
commit | 942213dfe28e464f068f8a195d1424c4b29af585 (patch) | |
tree | a9ce9c95cd546f2fea06500b8001bf3dfdc31019 /bin/zkServer.sh | |
parent | dec6ac782b12a80169fbff9093949e477e5075f0 (diff) | |
download | zookeeper-942213dfe28e464f068f8a195d1424c4b29af585.tar.gz |
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
Diffstat (limited to 'bin/zkServer.sh')
-rwxr-xr-x | bin/zkServer.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/zkServer.sh b/bin/zkServer.sh index b83848a4a..ec3db140f 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 |