Log a warning when a worker was terminated due to a signal

This happens for example when being OOM killed.

See #2215
This commit is contained in:
Armin Berres 2020-12-16 11:05:27 +01:00
parent 548d5828da
commit b695b497b9

View File

@ -526,6 +526,12 @@ class Arbiter(object):
if exitcode == self.APP_LOAD_ERROR:
reason = "App failed to load."
raise HaltServer(reason, self.APP_LOAD_ERROR)
if os.WIFSIGNALED(status):
self.log.warning(
"Worker with pid %s was terminated due to signal %s",
wpid,
os.WTERMSIG(status)
)
worker = self.WORKERS.pop(wpid, None)
if not worker: