diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2019-03-22 12:22:15 -0400 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-22 17:43:13 +0000 |
commit | fc6721ac83c2626982f6c796f82b1386f123c66f (patch) | |
tree | bb691053dcc083e92c9a9be0a156add3dd734198 /LICENSE | |
parent | bfda850eb26f782e841480e0fa45a79c8cbbbd78 (diff) | |
download | sos-fc6721ac83c2626982f6c796f82b1386f123c66f.tar.gz |
[Plugin] Terminate running commands when a plugin exceeds timeout
Previously, if a plugin timeout was hit the thread it was running in
would be destroyed, however if it were running a command (ultimately
handled by a Popen() call), that command would still continue to run
under PID 1. This could then cause sos to report I/O exceptions after
the archive has been closed with an attempt to write to the temporary
directory used for the archive.
Now, utilities.sos_get_command_output() accepts (and is handed from
Plugin) a polling method that is used to monitor if the timeout has been
hit and will call terminate() to end kill the running command if that
polling method returns True.
For commands run outside of a plugin, previous behavior remains the
same since now AsyncReader.get_contents() will block until the command
completes (regardless of exit code) rather than relying on the join()
when an AsyncReader was initialized as was done before.
Fixes: #1590
Resolves: #1615
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions