aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-01-13 16:34:12 -0500
committerJake Hunsaker <jhunsake@redhat.com>2021-01-13 16:34:12 -0500
commit5d87a4db0a24f879e92611e09475ae652fa4dff9 (patch)
treef9dab7ef6a14b61035164ccd5d3e3cd2343f2630
parenta8dbdd2143f693758b4df76a615d06c85d8638fd (diff)
downloadsos-5d87a4db0a24f879e92611e09475ae652fa4dff9.tar.gz
[process] Drop -b from lsof calls, add timeout
The `-b` option to `lsof` is used to avoid kernel calls that have the potential to block. However, this in turn strips useful information from this collection when processes are using network resources like NFS shares. As we now have several layers of timeout control, it should be safe to remove the `-b` option and instead apply a timeout to the `add_cmd_output()` call to protect against a potential blocked call. Closes: #2352 Resolves: #2670 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/process.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sos/report/plugins/process.py b/sos/report/plugins/process.py
index b8fa9d3c..65c69733 100644
--- a/sos/report/plugins/process.py
+++ b/sos/report/plugins/process.py
@@ -44,10 +44,11 @@ class Process(Plugin, IndependentPlugin):
tags=['ps_aux', 'ps_auxww', 'ps_auxwww'])
self.add_cmd_output("pstree -lp", root_symlink="pstree")
if self.get_option("lsof"):
- self.add_cmd_output("lsof -b +M -n -l -c ''", root_symlink="lsof")
+ self.add_cmd_output("lsof +M -n -l -c ''", root_symlink="lsof",
+ timeout=15)
if self.get_option("lsof-threads"):
- self.add_cmd_output("lsof -b +M -n -l")
+ self.add_cmd_output("lsof +M -n -l", timeout=15)
self.add_cmd_output([
"ps auxwwwm",