Skip to content

Commit 7ca05ec

Browse files
authored
Merge pull request benoitc#2475 from m2p-consulting/log-killed
Log a warning when a worker was terminated due to a signal
2 parents b7f2a82 + b695b49 commit 7ca05ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gunicorn/arbiter.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,12 @@ def reap_workers(self):
526526
if exitcode == self.APP_LOAD_ERROR:
527527
reason = "App failed to load."
528528
raise HaltServer(reason, self.APP_LOAD_ERROR)
529+
if os.WIFSIGNALED(status):
530+
self.log.warning(
531+
"Worker with pid %s was terminated due to signal %s",
532+
wpid,
533+
os.WTERMSIG(status)
534+
)
529535

530536
worker = self.WORKERS.pop(wpid, None)
531537
if not worker:

0 commit comments

Comments
 (0)