Skip to content
Snippets Groups Projects
Commit 6e237482 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

jqueue: Fix error when WaitForJobChange gets invalid ID


When JobQueue.WaitForJobChange gets an invalid or no longer existing job ID it
tries to return job_info and log_entries, both of which aren't defined yet.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent a9e97393
No related branches found
No related tags found
No related merge requests found
......@@ -1101,6 +1101,10 @@ class JobQueue(object):
"""
logging.debug("Waiting for changes in job %s", job_id)
job_info = None
log_entries = None
end_time = time.time() + timeout
while True:
delta_time = end_time - time.time()
......@@ -1142,7 +1146,10 @@ class JobQueue(object):
logging.debug("Job %s changed", job_id)
return (job_info, log_entries)
if job_info is None and log_entries is None:
return None
else:
return (job_info, log_entries)
@utils.LockedMethod
@_RequireOpenQueue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment