Skip to content

Commit

Permalink
Handle sacct failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Nov 6, 2023
1 parent e15d876 commit fe4928d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/profiles/slurm-sge-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ if [ "x$slurm" != "x" ] ; then
fi

jobstatus=$($sacct -j "$jobid" --noheader)
if [ $? != 0 ] ; then # If sacct fails, report
echo running # that the job is running.
if [ $? != 0 -o "x$jobstatus" = "x" ] ; then # If sacct fails,
sleep 2 # pause a bit, then
echo running # report that the job is running.
echo 1>&2 "Job $jobid not known (yet) by slurm; will return 'running' by default."
exit 0
fi
Expand Down

0 comments on commit fe4928d

Please sign in to comment.