Commit 320d1daf authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

jqueue: Resume jobs from “waitlock” status (2nd try)

Commit 5ef699a0

 had to roll back an earlier attempt at implementing
this. With the improved job queue processer, this is finally possible.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b8802cc4
......@@ -1242,15 +1242,22 @@ class JobQueue(object):
status = job.CalcStatus()
if status in (constants.JOB_STATUS_QUEUED, ):
if status == constants.JOB_STATUS_QUEUED:
restartjobs.append(job)
elif status in (constants.JOB_STATUS_RUNNING,
constants.JOB_STATUS_WAITLOCK,
constants.JOB_STATUS_CANCELING):
logging.warning("Unfinished job %s found: %s", job.id, job)
job.MarkUnfinishedOps(constants.OP_STATUS_ERROR,
"Unclean master daemon shutdown")
if status == constants.JOB_STATUS_WAITLOCK:
# Restart job
job.MarkUnfinishedOps(constants.OP_STATUS_QUEUED, None)
restartjobs.append(job)
else:
job.MarkUnfinishedOps(constants.OP_STATUS_ERROR,
"Unclean master daemon shutdown")
self.UpdateJobUnlocked(job)
if restartjobs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment