mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-08 13:41:31 +08:00
Disable setproctitle on macOS to prevent segfaults
setproctitle causes segfaults on macOS due to fork() safety issues introduced in newer macOS versions. The mere import of setproctitle can trigger crashes in forked worker processes. Fixes #3021
This commit is contained in:
parent
481dbf2e9b
commit
be6f3b97ab
@ -46,12 +46,18 @@ hop_headers = set("""
|
||||
server date
|
||||
""".split())
|
||||
|
||||
try:
|
||||
# setproctitle causes segfaults on macOS due to fork() safety issues
|
||||
# https://github.com/benoitc/gunicorn/issues/3021
|
||||
if sys.platform == "darwin":
|
||||
def _setproctitle(title):
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
from setproctitle import setproctitle
|
||||
|
||||
def _setproctitle(title):
|
||||
setproctitle("gunicorn: %s" % title)
|
||||
except ImportError:
|
||||
except ImportError:
|
||||
def _setproctitle(title):
|
||||
pass
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user