04/06 remediate some issues

This commit is contained in:
2026-04-06 16:31:50 -04:00
parent d7293f2747
commit 3b17705911
8 changed files with 211 additions and 28 deletions
+11 -1
View File
@@ -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()