Skip to content

Commit

Permalink
Attempt to recover job uid label if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolan Woods committed Sep 29, 2020
1 parent a2ec7b6 commit 27d0052
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/galaxy/jobs/runners/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,15 @@ def queue_job(self, job_wrapper):
job.create()
job_id = getattr(job.labels, JOB_ID_LABEL, False)
if not job_id:
job_wrapper.fail("Unexpected value from job runner", exception=True)
log.exception("%s not assigned by k8s to job on invocation: %s" % (JOB_ID_LABEL, job.obj))
return
# Recover uid label because it wasn't set
job.labels[JOB_ID_LABEL] = job.metadata.uid
job.update()
job_id = getattr(job.labels, JOB_ID_LABEL, False)
if not job_id:
job_wrapper.fail("Unexpected value from job runner", exception=True)
log.exception("%s not assigned by k8s to job on invocation: %s" % (JOB_ID_LABEL, job.obj))
return

# define job attributes in the AsyncronousJobState for follow-up
ajs.job_id = job_id
# store runner information for tracking if Galaxy restarts
Expand Down

0 comments on commit 27d0052

Please sign in to comment.