summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smith <qinusty@gmail.com>2018-08-14 16:44:17 +0100
committerJosh Smith <qinusty@gmail.com>2018-08-16 14:26:02 +0100
commit5637231926c667c34ca01eb21447c8e4eaa05722 (patch)
tree517dd642f6e3de2e612556584809ba93122b70bf
parent04f836796d6d7f45a69ae607deebf3fb5b133611 (diff)
downloadbuildstream-Qinusty/531-fetch-retries-on-terminate.tar.gz
job.py: Prevent terminated jobs retryingQinusty/531-fetch-retries-on-terminate
Fixes #531: Jobs were retrying when terminated, this lead to the process being spawned again and starting up fresh.
-rw-r--r--buildstream/_scheduler/jobs/job.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_scheduler/jobs/job.py b/buildstream/_scheduler/jobs/job.py
index c339a333b..922ce5613 100644
--- a/buildstream/_scheduler/jobs/job.py
+++ b/buildstream/_scheduler/jobs/job.py
@@ -250,7 +250,7 @@ class Job():
#
def resume(self, silent=False):
if self._suspended:
- if not silent:
+ if not silent and not self._scheduler.terminated:
self.message(MessageType.STATUS,
"{} resuming".format(self.action_name))
@@ -549,7 +549,7 @@ class Job():
#
self._retry_flag = returncode not in (RC_OK, RC_PERM_FAIL)
- if self._retry_flag and (self._tries <= self._max_retries):
+ if self._retry_flag and (self._tries <= self._max_retries) and not self._scheduler.terminated:
self.spawn()
return