Unverified Commit 25861047 authored by John Chilton's avatar John Chilton Committed by GitHub
Browse files

Merge pull request #11876 from natefoo/total-walltime-fix

[20.09] Fix user total walltime calculation when jobs are missing states in job state history
parents 69b65ac9 e015db02
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -611,7 +611,11 @@ class JobHandlerQueue(Monitors):
                    elif history.state == "ok":
                        finished = history.create_time

                if started is not None and finished is not None:
                    time_spent += finished - started
                else:
                    log.warning("Unable to calculate time spent for job %s; started: %s, finished: %s",
                                job.id, started, finished)

            if time_spent > self.app.job_config.limits.total_walltime["delta"]:
                return JOB_USER_OVER_TOTAL_WALLTIME, job_destination