From 52a8f90ab0d804c074606b7ca60351b547e50315 Mon Sep 17 00:00:00 2001 From: Tyson Smith Date: Thu, 4 Jul 2024 09:52:09 -0700 Subject: [PATCH] Put benign exits codes in a frozenset --- src/ffpuppet/core.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ffpuppet/core.py b/src/ffpuppet/core.py index 6957495..f09865b 100644 --- a/src/ffpuppet/core.py +++ b/src/ffpuppet/core.py @@ -44,6 +44,12 @@ # config_job_object is only available on Windows from .job_object import config_job_object, resume_suspended_process + +# Note: ignore 245 for now to avoid getting flooded with OOMs that don't +# have a crash report... this should be revisited when time allows +# https://bugzil.la/1370520 +# Ignore -9 to avoid false positives due to system OOM killer +BENIGN_EXIT_CODES = frozenset((0, 1, 2, 9, 15, 245)) LOG = getLogger(__name__) __author__ = "Tyson Smith" @@ -502,11 +508,7 @@ def close(self, force_close: bool = False) -> None: LOG.warning("Crash reports disappeared! How did this happen?") elif self._proc_tree.is_running(): r_code = Reason.CLOSED - elif abs(self._proc_tree.wait()) not in {0, 1, 2, 9, 15, 245}: - # Note: ignore 245 for now to avoid getting flooded with OOMs that don't - # have a crash report... this should be revisited when time allows - # https://bugzil.la/1370520 - # Ignore -9 to avoid false positives due to system OOM killer + elif abs(self._proc_tree.wait()) not in BENIGN_EXIT_CODES: exit_code = self._proc_tree.wait() r_code = Reason.ALERT LOG.warning(