fix(v1): guard the pool health reply so a departed client can't crash the pool#2080
Open
dumko2001 wants to merge 1 commit into
Open
fix(v1): guard the pool health reply so a departed client can't crash the pool#2080dumko2001 wants to merge 1 commit into
dumko2001 wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR — under
ROUTER_MANDATORY=1, one client abandoning a health poll crashes the entire env-server pool (all workers, all in-flight rollouts). Three-line fix.Repro
Client calls
.health()on a short timeout, times out, and closes its DEALER socket in the gap between the broker reading the request (pool.py:196) and sending the reply (pool.py:199). The ROUTER has already dropped that identity, so the send raiseszmq.ZMQError.Impact
run()'s only handler isexcept (asyncio.CancelledError, KeyboardInterrupt)(pool.py:239), so theZMQErrorescapes the loop. It unwinds intofinally: self._shutdown()(pool.py:242), which callsw["process"].terminate()on every worker (pool.py:249). The whole pool goes down, killing every concurrent rollout, not just the health request that triggered it.Fix
The worker-reply send two branches down already uses this exact guard (
pool.py:235); the health send was the one path missing it. Live clients are unaffected, since the suppress only swallows a send to a peer that's already gone. Happy to add a regression test that drops a client mid-health poll.Reopens #2071.