Skip to content

Commit

Permalink
no need to kill kafka or zookeeper
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed May 6, 2024
1 parent e6dc92f commit ddf245c
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions backwards-compat-tests/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,6 @@ KAFKA_PATH=.risingwave/bin/kafka
mkdir -p $TEST_DIR
cp -r backwards-compat-tests/slt/* $TEST_DIR

wait_kafka_exit() {
# Follow kafka-server-stop.sh
while [[ -n "$(ps ax | grep ' kafka\.Kafka ' | grep java | grep -v grep | awk '{print $1}')" ]]; do
echo "Waiting for kafka to exit"
sleep 1
done
}

wait_zookeeper_exit() {
# Follow zookeeper-server-stop.sh
while [[ -n "$(ps ax | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}')" ]]; do
echo "Waiting for zookeeper to exit"
sleep 1
done
}

kill_kafka() {
$KAFKA_PATH/bin/kafka-server-stop.sh
wait_kafka_exit
}

kill_zookeeper() {
$KAFKA_PATH/bin/zookeeper-server-stop.sh
wait_zookeeper_exit
}

wait_for_process() {
process_name="$1"

Expand Down Expand Up @@ -77,21 +51,9 @@ kill_cluster() {

# Kill other components
$TMUX list-windows -t risedev -F "#{window_name} #{pane_id}" |
grep -v 'kafka' |
grep -v 'zookeeper' |
awk '{ print $2 }' |
xargs -I {} $TMUX send-keys -t {} C-c C-d

set +e
if [[ -n $($TMUX list-windows -t risedev | grep kafka) ]]; then
echo "kill kafka"
kill_kafka

echo "kill zookeeper"
kill_zookeeper
fi
set -e

$TMUX kill-server
test $? -eq 0 || {
echo "Failed to stop all RiseDev components."
Expand Down

0 comments on commit ddf245c

Please sign in to comment.