From 7a795b86816e816f52ae25d1cb539f88fe72d898 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Thu, 29 Jun 2017 13:27:17 -0400 Subject: [PATCH] fix job launch deadlock * This both fixes the deadlock problem and a logic problem. We shouldn't set the job's job_template current_job to pending jobs. --- awx/main/models/unified_jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index a763239d15..e9a4f00c91 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -713,7 +713,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique result = super(UnifiedJob, self).save(*args, **kwargs) # If status changed, update the parent instance. - if self.status != status_before: + if self.status != status_before and self.status != 'pending': self._update_parent_instance() # Done.