diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2020-06-08 16:10:29 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-06-10 10:05:11 -0400 |
commit | fc3b837f64a4fc572449f3beffebb3c20383ba24 (patch) | |
tree | 64b09b908b3ad8006204e162a6ef08142dcff463 | |
parent | 4d6f4c09a9b80a6755e068dd318badc5d1492c17 (diff) | |
download | sos-fc3b837f64a4fc572449f3beffebb3c20383ba24.tar.gz |
[report] Immediately exit on first fatal error from plugins
Updates our exit path when we encounter a fatal filesystem error
(ENOSPC, EROFS) to use `os._exit(1)` rather than our own `_exit()`
method so that we can properly exit from the ThreadPool.
This does leave the temporary directory in place on the filesystem, so
the exit message has been updated to highlight that fact to the end
user.
Closes: #2071
Resolves: #2108
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/report/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sos/report/__init__.py b/sos/report/__init__.py index 677d8693..04c2749e 100644 --- a/sos/report/__init__.py +++ b/sos/report/__init__.py @@ -977,9 +977,11 @@ class SoSReport(SoSComponent): pass except (OSError, IOError) as e: if e.errno in fatal_fs_errors: - self.ui_log.error("\n %s while collecting plugin data\n" + self.ui_log.error("\n %s while collecting plugin data" % e.strerror) - self._exit(1) + self.ui_log.error(" Data collected still available at %s\n" + % self.tmpdir) + os._exit(1) self.handle_exception(plugname, "collect") except Exception: self.handle_exception(plugname, "collect") |