diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-07 11:04:31 -0500 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-07 11:47:01 -0500 |
commit | 891fcb0e3a68bc4df07b9bb2b8b664d65432bc37 (patch) | |
tree | c2fdabb646d5f82c67aa1729b5cc45d5869d9310 /buildstream/utils.py | |
parent | 7dfb85b35a71c239f592e3aed50eddeddcd10406 (diff) | |
download | buildstream-tristan/keyboard-interrupt-stack-trace.tar.gz |
Fix stack traces discovered with ^C forceful termination.tristan/keyboard-interrupt-stack-trace
* utils.py:_kill_process_tree(): Ignore NoSuchProcess errors
These are caused because we issue SIGTERM, and if the process
has not exited after a timeout, we kill it.
* _scheduler/jobs/job.py: Stop handling NoSuchProcess errors here
redundantly, they are already ignored.
It seems that we were ignoring it after sleeping when terminating
tasks from the scheduler... but we were not ignoring it when performing
the same pattern in the `Plugin.call()` -> `utils._call()` path, so
we were still getting these exceptions at termination time from host
tool processes launched by source plugins.
Diffstat (limited to 'buildstream/utils.py')
-rw-r--r-- | buildstream/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py index a4600319b..494333680 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -1050,6 +1050,11 @@ def _kill_process_tree(pid): # Ignore this error, it can happen with # some setuid bwrap processes. pass + except psutil.NoSuchProcess: + # It is certain that this has already been sent + # SIGTERM, so there is a window where the process + # could have exited already. + pass # Bloody Murder for child in children: |