Skip to content

Commit

Permalink
fix: Attempt to fix spot request hangs. (#3241)
Browse files Browse the repository at this point in the history
As title.
  • Loading branch information
charlielye authored Nov 6, 2023
1 parent 2de206d commit a062026
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions build-system/scripts/request_spot
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ done

# Wait till ssh port is open.
>&2 echo "Waiting for SSH at $IP..."
for I in {1..60}; do
if nc -z $IP 22; then
echo $IP
exit 0
SECONDS=0
while ! nc -z -w1 $IP 22; do
if (( SECONDS >= 60 )); then
>&2 echo "Timeout: SSH port 22 at $IP did not become available after 60 seconds."
exit 1
fi
sleep 1
done
exit 1
echo $IP

0 comments on commit a062026

Please sign in to comment.