github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/tests/integration_tests/_utils/kill_cdc_pid (about) 1 #!/bin/bash 2 # parameter 1: process 3 4 pid=$1 5 retry_count=20 6 7 kill $pid || true 8 9 counter=0 10 while [ $counter -lt $retry_count ]; do 11 ps $pid >/dev/null 2>&1 12 ret=$? 13 if [ "$ret" != "0" ]; then 14 echo "process $pid already exit" 15 exit 0 16 fi 17 ((counter += 1)) 18 sleep 0.5 19 kill $pid || true 20 echo "wait process $pid exit for $counter-th time..." 21 done 22 23 echo "wait process $pid exit timeout" 24 exit 1