Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arbiter: don't log if handling SIGCHLD #3064

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gunicorn/arbiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def run(self):

def handle_chld(self, sig, frame):
"SIGCHLD handling"
self.reap_workers()
self.reap_workers(signal_safe=False)
self.wakeup()

def handle_hup(self):
Expand Down Expand Up @@ -507,7 +507,7 @@ def murder_workers(self):
else:
self.kill_worker(pid, signal.SIGKILL)

def reap_workers(self):
def reap_workers(self, signal_safe=True):
"""\
Reap workers to avoid zombie processes
"""
Expand All @@ -532,12 +532,12 @@ def reap_workers(self):
reason = "App failed to load."
raise HaltServer(reason, self.APP_LOAD_ERROR)

if exitcode > 0:
if signal_safe and exitcode > 0:
# If the exit code of the worker is greater than 0,
# let the user know.
self.log.error("Worker (pid:%s) exited with code %s.",
wpid, exitcode)
elif status > 0:
elif signal_safe and status > 0:
# If the exit code of the worker is 0 and the status
# is greater than 0, then it was most likely killed
# via a signal.
Expand Down