04/06 remediate some issues
This commit is contained in:
+11
-1
@@ -45,7 +45,17 @@ pidfile = "/tmp/it_tickets.pid"
|
||||
|
||||
|
||||
def post_fork(server, worker):
|
||||
"""Called after a worker is forked. Patch eventlet per-worker."""
|
||||
"""Called after a worker is forked.
|
||||
|
||||
Defensive monkey-patch — eventlet is already patched by the time this
|
||||
runs (run.py calls eventlet.monkey_patch() at module level, which fires
|
||||
before gunicorn loads the app with preload_app=False), so this call is
|
||||
technically redundant. It is retained as a belt-and-suspenders guard:
|
||||
if the startup order ever changes (e.g. a future gunicorn version alters
|
||||
worker bootstrap sequencing), the patch here ensures green-thread safety
|
||||
is still applied before any request is served. Double-patching is safe
|
||||
in eventlet — it is idempotent and produces no side effects.
|
||||
"""
|
||||
import eventlet
|
||||
eventlet.monkey_patch()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user