diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2018-11-29 17:45:59 -0500 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-19 17:36:33 +0000 |
commit | 2463612fc00c574b4b49c514fd4dac8d0b319d4a (patch) | |
tree | fcc49bc73a7dafe8e031145f39dc9fe20633dbd0 | |
parent | 430806a2bc1d11b60b867e0296e7200e17595cfc (diff) | |
download | sos-2463612fc00c574b4b49c514fd4dac8d0b319d4a.tar.gz |
[sosreport] Clear nested threadpool threads on timeout
We nest ThreadPoolExecutors to run plugins to enable whole-plugin
timeouts, with the timeout being handled by the nested threadpool.
However, calling shutdown() on the nested thread is incorrect in the
event of a plugin timeout, as it only cancels pending jobs, not
currently running jobs that the timed-out plugin is.
Instead, call _threads.clear() to forcibly cancel the running job, thus
allowing the thread the return to the higher level threadpool and allow
other plugins to run via that thread.
This still allows data captured up to the point of the timeout to be
written to the sosreport.
Fixes: #1446
Resolves: #1492
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/sosreport.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index d8c862db..47fcc0cd 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -1103,7 +1103,7 @@ class SoSReport(object): except TimeoutError: self.ui_log.error("\n Plugin %s timed out\n" % plugin[1]) self.running_plugs.remove(plugin[1]) - pool.shutdown(wait=False) + pool._threads.clear() def collect_plugin(self, plugin): try: |