Skip to content

Commit b588049

Browse files
committed
shutdown: limit wait time if forced
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.
1 parent 2af31ea commit b588049

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

etc/shutdown

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/bin/sh
22

3+
force=
4+
while getopts f namer; do
5+
case $name in
6+
f) force=1 ;;
7+
esac
8+
done
9+
310
flux queue stop --quiet --all --nocheckpoint
411
flux cancel --user=all --quiet --states RUN
5-
flux queue idle --quiet
12+
13+
if $force; then
14+
timeout="--timeout=10s"
15+
fi
16+
flux queue idle --quiet $timeout

0 commit comments

Comments
 (0)