Skip to content

Commit

Permalink
Put benign exits codes in a frozenset
Browse files Browse the repository at this point in the history
  • Loading branch information
tysmith committed Jul 4, 2024
1 parent 79d0dad commit 52a8f90
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ffpuppet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 52a8f90

Please sign in to comment.