Skip to content

Commit

Permalink
Merge pull request #2475 from m2p-consulting/log-killed
Browse files Browse the repository at this point in the history
Log a warning when a worker was terminated due to a signal
  • Loading branch information
benoitc committed Dec 17, 2020
2 parents b7f2a82 + b695b49 commit 7ca05ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gunicorn/arbiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@ def reap_workers(self):
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:
Expand Down

0 comments on commit 7ca05ec

Please sign in to comment.