Skip to content

Commit

Permalink
fix: race condition if pid too long to kill (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert authored Nov 20, 2023
1 parent 3d7d0a0 commit 4375630
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/restart-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ do
child=$!
sleep 5
echo "killing pid $child..." && sleep 5 && kill -9 "$child"
while kill -0 "$child" 2> /dev/null; do # wait for child to exit (kill -0 is falsy if pid is gone)
sleep 1
done
done

0 comments on commit 4375630

Please sign in to comment.