Closed tback closed 3 days ago
I just noticed this should be logged already. Yet I don't see exit code 137 while I'm quite sure it happens. Will update (and hopefully close) in about two hours https://github.com/benoitc/gunicorn/blob/bacbf8aa5152b94e44aa5d2a94aeaf0318a85248/gunicorn/arbiter.py#L528
Conclusion: Exit code 137 is not magically produced in case of an OOMKill. It's neither a clear indicator for it. Exit code 137 is the result of adding the number of the signal (9
for SIGKILL
) and 128 (the base number for signal exits).
It'd be really great if the exit code of workers could be preserved in the worker class. That way we could log unusual ones. My reason for asking for this is that I'm trying to find processes that have be targeted by the oom killer. Those receive exit code 137. Then I could define a
child_exit
funktion that log what happened: