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 <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12160
This commit is contained in:
Rich Ercolani 2021-06-01 17:20:50 -04:00 committed by Brian Behlendorf
parent 1fb18c4bde
commit cc9dae2404
1 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,7 @@ import os
import subprocess import subprocess
import sys import sys
import time import time
import errno
# We can't use env -S portably, and we need python3 -u to handle pipes in # 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... # 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 # It turns out that while sys.exit() triggers an exception
# not handled message on Python 3.8+, os._exit() does not. # not handled message on Python 3.8+, os._exit() does not.
os._exit(0) os._exit(0)
if ex_cls is OSError:
if ex.errno == errno.ENOTCONN:
sys.exit()
raise ex raise ex
if hasattr(sys,'unraisablehook'): # Python 3.8+ if hasattr(sys,'unraisablehook'): # Python 3.8+