Skip to content

Commit 76b9ee5

Browse files
committed
Put benign exits codes in a frozenset
1 parent 3ca7468 commit 76b9ee5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/ffpuppet/core.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
# config_job_object is only available on Windows
4545
from .job_object import config_job_object, resume_suspended_process
4646

47+
48+
# Note: ignore 245 for now to avoid getting flooded with OOMs that don't
49+
# have a crash report... this should be revisited when time allows
50+
# https://bugzil.la/1370520
51+
# Ignore -9 to avoid false positives due to system OOM killer
52+
BENIGN_EXIT_CODES = frozenset((0, 1, 2, 9, 15, 245))
4753
LOG = getLogger(__name__)
4854

4955
__author__ = "Tyson Smith"
@@ -502,11 +508,7 @@ def close(self, force_close: bool = False) -> None:
502508
LOG.warning("Crash reports disappeared! How did this happen?")
503509
elif self._proc_tree.is_running():
504510
r_code = Reason.CLOSED
505-
elif abs(self._proc_tree.wait()) not in {0, 1, 2, 9, 15, 245}:
506-
# Note: ignore 245 for now to avoid getting flooded with OOMs that don't
507-
# have a crash report... this should be revisited when time allows
508-
# https://bugzil.la/1370520
509-
# Ignore -9 to avoid false positives due to system OOM killer
511+
elif abs(self._proc_tree.wait()) not in BENIGN_EXIT_CODES:
510512
exit_code = self._proc_tree.wait()
511513
r_code = Reason.ALERT
512514
LOG.warning(

0 commit comments

Comments
 (0)