Skip to content

Commit

Permalink
shutdown: limit wait time if forced
Browse files Browse the repository at this point in the history
Problem: the 'flux queue idle' command in the shutdown script
can wait a long time if jobs are stuck in CLEANUP.

If the script receives the -f option from 'flux shutdown --force',
abort after a 10s timeout.
  • Loading branch information
garlick committed Apr 5, 2024
1 parent 2af31ea commit b588049
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion etc/shutdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/sh

force=
while getopts f namer; do
case $name in
f) force=1 ;;
esac
done

flux queue stop --quiet --all --nocheckpoint
flux cancel --user=all --quiet --states RUN
flux queue idle --quiet

if $force; then
timeout="--timeout=10s"
fi
flux queue idle --quiet $timeout

0 comments on commit b588049

Please sign in to comment.