From 6c1a108b70099b6c6f7bbd09b5966b24ebcb0a55 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 29 May 2024 09:28:19 +0200 Subject: [PATCH] Fix connections check in teardown script conns may return the following error: This ZooKeeper instance is not currently serving requests Signed-off-by: Azat Khuzhin --- docker/bin/zookeeperTeardown.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/bin/zookeeperTeardown.sh b/docker/bin/zookeeperTeardown.sh index da361b8d..60e52e22 100755 --- a/docker/bin/zookeeperTeardown.sh +++ b/docker/bin/zookeeperTeardown.sh @@ -18,10 +18,10 @@ DATA_DIR=/data MYID_FILE=$DATA_DIR/myid LOG4J_CONF=/conf/log4j-quiet.properties -# Wait for client connections to drain. Kubernetes will wait until the confiugred +# Wait for client connections to drain. Kubernetes will wait until the configured # "terminationGracePeriodSeconds" before focibly killing the container for (( i = 0; i < 6; i++ )); do - CONN_COUNT=`echo cons | socat stdio tcp:localhost:$CLIENT_PORT | grep -v "^$" |grep -v "/127.0.0.1:" | wc -l` + CONN_COUNT=`echo cons | socat stdio tcp:localhost:$CLIENT_PORT | grep -v "^$" |grep -v -e "/127.0.0.1:" -e "This ZooKeeper instance is not currently serving requests" | wc -l` if [[ "$CONN_COUNT" -gt 0 ]]; then echo "$CONN_COUNT non-local connections still connected." sleep 5