aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Ercolani <[email protected]>2021-06-01 17:20:50 -0400
committerBrian Behlendorf <[email protected]>2021-06-09 13:05:34 -0700
commitcc9dae24040a11c72e5fd26f32e985a80f7340ec (patch)
tree1dd7ee30568c4aa5f975b6f905e5f071e128778b
parent1fb18c4bdea7442cb94320ee293fea8d3e08a706 (diff)
Added another missed case to arc_summary3
It turns out that sometimes, evidently only when run inside the ZTS handler, arc_summary3 | head > /dev/null will die with ENOTCONN, and ruin the test run. Added handling for that. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12160
-rwxr-xr-xcmd/arc_summary/arc_summary36
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/arc_summary/arc_summary3 b/cmd/arc_summary/arc_summary3
index d5b548999..7b28012ed 100755
--- a/cmd/arc_summary/arc_summary3
+++ b/cmd/arc_summary/arc_summary3
@@ -42,6 +42,7 @@ import os
import subprocess
import sys
import time
+import errno
# We can't use env -S portably, and we need python3 -u to handle pipes in
# the shell abruptly closing the way we want to, so...
@@ -239,6 +240,11 @@ def handle_Exception(ex_cls, ex, tb):
# It turns out that while sys.exit() triggers an exception
# not handled message on Python 3.8+, os._exit() does not.
os._exit(0)
+
+ if ex_cls is OSError:
+ if ex.errno == errno.ENOTCONN:
+ sys.exit()
+
raise ex
if hasattr(sys,'unraisablehook'): # Python 3.8+