diff --git a/buildman/component/buildcomponent.py b/buildman/component/buildcomponent.py index 14df0c6aa..47afe798d 100644 --- a/buildman/component/buildcomponent.py +++ b/buildman/component/buildcomponent.py @@ -367,11 +367,14 @@ class BuildComponent(BaseComponent): logger.debug('Got remote failure exception for build %s: %s', build_id, aex) yield From(self._build_finished(BuildJobResult.ERROR)) + # Remove the current job. + self._current_job = None + + @trollius.coroutine def _build_finished(self, job_status): """ Alerts the parent that a build has completed and sets the status back to running. """ yield From(self.parent_manager.job_completed(self._current_job, job_status, self)) - self._current_job = None # Set the component back to a running state. yield From(self._set_status(ComponentStatus.RUNNING)) @@ -481,7 +484,9 @@ class BuildComponent(BaseComponent): yield From(self.parent_manager.job_completed(self._current_job, BuildJobResult.INCOMPLETE, self)) - self._current_job = None # Unregister the current component so that it cannot be invoked again. self.parent_manager.build_component_disposed(self, True) + + # Remove the job reference. + self._current_job = None