Repository navigation
fix(eval): fail served rollouts when the server process exits - #2596
Closed
gultekinhasancan79 wants to merge 1 commit into
Closed
gultekinhasancan79 wants to merge 1 commit into
gultekinhasancan79 wants to merge 1 commit into
Conversation
Author
|
Closing this: #2512 made One related gap: prime-rl's new |
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.
The eval CLI can wait indefinitely in
client.run()when its spawned env-server process exits after the startup health check. A ZMQ peer disappearing does not fail the pending receive. The runner now watches the process it owns and raises an error with the exit code and log path, allowinggather_rollouts()to cancel and drain the remaining work.Each request races against one shared process watcher. A completed reply keeps precedence; healthy rollouts remain untimed. Cancelled requests are awaited so the existing wire cancellation and client teardown still run.
This addresses the eval-side process-liveness part of #2571. It complements #2131: this change detects exit of the server/broker process owned by the eval, while worker recovery and startup readiness remain separate.
Validation uses a spawned local ZMQ ROUTER and the production
_server,EnvClient, andgather_rolloutspaths. It makes no model calls. On basef9121b8e4ef8ec284c07961b499f646bcf92fac6, 6 scenarios time out and 3 controls pass; with this patch all 9 pass. Coverage includes exit codes 0 and 23, multiple in-flight requests, semaphore-queued work, completed episodes, ordinary request errors, and caller cancellation.The focused probe is temporary, following
AGENTS.md. A minimal standalone reproduction is included below.Contributor checks (Linux, Python 3.12.13):
UV_NO_SYNC=1 uv run pytest tests/: 86 passed, 77 skipped (live tests requirePRIME_API_KEY).UV_NO_SYNC=1 uv run ruff check --fix .: passed.UV_NO_SYNC=1 uv run ty check verifiers: passed.UV_NO_SYNC=1 uv run pre-commit run --all-files: passed.Dependencies came from the unchanged
uv.lock, exported withuv export --frozenand installed with pip's hash verification after uv downloads failed in the test container.UV_NO_SYNC=1preserves that installed environment. No dependency or lockfile changes are included.Model-free reproduction
Save as
repro_eval_server_exit.pyoutside the checkout, then run it from an installed checkout withuv run --no-sync python /path/to/repro_eval_server_exit.py.Base: the outer 5-second safety timeout reports
BUG. Patched: aRuntimeErrorreports the server's exit code 23 and the script reportsPASS. Only the spawned server target is replaced with a small local ROUTER; the eval runner and client are production code.Note
Fail served rollouts when environment-server process exits
wait_for_exitcoroutine that polls the spawned environment-server process and completes when it terminates.runner.py_server.runnow cancels and awaits the request task on all exit paths.Macroscope summarized bc2cf6f.