Skip to content

Commit

Permalink
Added another missed case to arc_summary3
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rincebrain authored Jun 1, 2021
1 parent e1af0d0 commit 8bd41eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/arc_summary/arc_summary3
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down Expand Up @@ -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+
Expand Down

0 comments on commit 8bd41eb

Please sign in to comment.