diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-05-31 17:55:26 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-05-31 17:55:26 +0900 |
commit | 33a8dfbd431e82b657d30c3defa4f43c811a9549 (patch) | |
tree | c8750c27e7ee233a45fb9ced8f4b7faef598ecb6 /buildstream/_scheduler/scheduler.py | |
parent | 551ab097fad51484f9797d6cd8a7a2f1d7f6ff3c (diff) | |
download | buildstream-33a8dfbd431e82b657d30c3defa4f43c811a9549.tar.gz |
scheduler.py: Kill child jobs if they do not terminate gracefully.
Diffstat (limited to 'buildstream/_scheduler/scheduler.py')
-rw-r--r-- | buildstream/_scheduler/scheduler.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/_scheduler/scheduler.py b/buildstream/_scheduler/scheduler.py index 317632e3f..0437d9559 100644 --- a/buildstream/_scheduler/scheduler.py +++ b/buildstream/_scheduler/scheduler.py @@ -146,8 +146,11 @@ class Scheduler(): # Forcefully terminates all ongoing jobs. # def terminate_jobs(self): + + # 20 seconds is a long time, but sometimes cleaning up man GB + # in a build directory can take a long time wait_start = datetime.datetime.now() - wait_limit = 10.0 + wait_limit = 20.0 with _signals.blocked([signal.SIGINT]): @@ -161,7 +164,8 @@ class Scheduler(): for job in queue.active_jobs: elapsed = datetime.datetime.now() - wait_start timeout = max(wait_limit - elapsed.total_seconds(), 0.0) - job.terminate_wait(timeout) + if not job.terminate_wait(timeout): + job.kill() self.loop.stop() self.terminated = True |