From 668bce8212f5b45360a31f9cbd1928db16a35283 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 0142dd957a..b7b5ca8073 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -712,7 +712,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.