fix: clarify comments in gevent_patch.py regarding blocking behavior in send_websocket_update

This commit is contained in:
SergeantPanda 2026-05-16 10:59:09 -05:00
parent c68249c314
commit bdfad0f314

View file

@ -12,8 +12,8 @@ Two things happen here:
gevent hub during I/O instead of blocking the OS thread.
Without (1), `async_to_sync(channel_layer.group_send)` in send_websocket_update
would call epoll_wait() directly, freezing every greenlet on the worker (the
90s pile-up observed on Worker 9). With (1), select.epoll is removed by
calls epoll_wait() directly, which blocks the OS thread and freezes all greenlets
on the worker until the call returns. With (1), select.epoll is replaced by
monkey-patching, which breaks asyncio event loop creation in threadpool threads.
send_websocket_update therefore uses a synchronous Redis path in gevent workers
instead of asyncio - see _gevent_ws_send() in core/utils.py.