Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci3/aws_handle_evict
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ while true; do
if curl -fs -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/meta-data/spot/termination-time &>/dev/null; then
# Termination notice found, exit with 155.
echo "Spot will be terminated! Exiting early."
fuser /dev/stdin /dev/stdout /dev/stderr 2>/dev/null | tr -s ' ' '\n' | grep -v $$ | xargs -r kill -9
pids=$(fuser /dev/stdin /dev/stdout 2>/dev/null)
echo "$pids" | tr -s ' ' '\n' | grep -v $$ | xargs -r kill -9
exit 155
fi
done