[Bugfix] Prevent stale multiproc RPC deadlines from becoming unbounded waits (#41357)

Signed-off-by: bugkeep <1921817430@qq.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
bugkeep
2026-07-29 16:41:34 -07:00
committed by GitHub
co-authored by Claude
parent 9d1aa4dda8
commit 48aa8d8d75
3 changed files with 175 additions and 2 deletions
@@ -909,7 +909,8 @@ class MessageQueue:
@staticmethod
def recv(socket: zmq.Socket, timeout: float | None) -> Any:
timeout_ms = None if timeout is None else int(timeout * 1000)
# Ensure non-negative timeout passed to zmq poll.
timeout_ms = None if timeout is None else max(0, int(timeout * 1000))
if not socket.poll(timeout=timeout_ms):
raise TimeoutError
recv, *recv_oob = socket.recv_multipart(copy=False)