From bdfad0f314ef9f9dde3f096430855f0dec5722ac Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sat, 16 May 2026 10:59:09 -0500 Subject: [PATCH] fix: clarify comments in gevent_patch.py regarding blocking behavior in send_websocket_update --- dispatcharr/gevent_patch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dispatcharr/gevent_patch.py b/dispatcharr/gevent_patch.py index 6727a5ac..86ac92ca 100644 --- a/dispatcharr/gevent_patch.py +++ b/dispatcharr/gevent_patch.py @@ -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.