Repository navigation
Conversation
Uploads and downloads that receive no response within request_timeout_s now go through the operation retry policy, like background command status and log polls (#3993). Rewriting the same bytes or rereading a file is idempotent, so a retry is safe. On HSG, OpenCode TB2.1 rollouts intermittently lose the process_supervisor.py upload: execd logs the request, then nothing answers until the 300 s timeout, and the rollout fails with HTTP 500. Signed-off-by: Felipe Vieira Frujeri <[email protected]>
e0aa1e7 to
8146f7d
Compare
|
/ok to test 8146f7d |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found.
Reviewed the provider changes, regression tests, and affected retry, staging, cleanup, and download paths. Timeout retries remain scoped to file transfers, retain configured attempt limits, and restart downloads by truncating the destination.
Static review only; tests were not executed.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
/ok to test 3a7edad |
@adil-a, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 3a7edad |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40556782812 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40755660359 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40756041200 |
What
OpenSandbox file uploads and downloads that get no response within
connection.request_timeout_snow go through the provider's operation retry policy (operations.retries, backoff) instead of failing on the firstTimeoutError.A new predicate,
_is_retryable_file_transfer_error, treatsTimeoutErroras retryable and otherwise falls back to_is_retryable_sdk_operation_error. Only_write_fileanddownload_fileuse it. Rewriting the same bytes to the same path is idempotent, and a retried download truncates and restarts the local file, so retrying is safe. Uploads keep the per-attemptrequest_timeout_sdeadline; streamed downloads still have no overall deadline, so for them this covers the SDK's per-read timeout. This follows the precedent of background command status and log polls, which already retry timeouts (#3993). Other operations keep treating a timeout as terminal.Why
On HSG, OpenCode TB2.1 runs on
mainlost 52 of 267 rollouts (about 19.5%) to one error:The agent surfaced this as HTTP 500 /
environment_server_failed.The sandbox's own
execdlog shows the request arriving (http: POST /files/upload) and then nothing until the 300 s client timeout. A retry immediately afterwards succeeds and the harness launches normally.execd's HTTP server sets no timeouts, and the server proxy streams request bodies with no read deadline, so a stalled upload never produces an error response. The root cause of the stall is not identified yet. It reproduces from HSG and JHB, but not from a workstation: about 96 attempts from a workstation never hung, including a run at full concurrency (267 sandboxes, 8 concurrent activations). It also hits OpenCode only; Pi, Codex, Hermes, OpenClaw and Terminus had zero such timeouts. This PR makes the stall recoverable instead of fatal.No issue filed; the investigation notes are summarized here.
Validation
pytest tests/unit_tests/test_opensandbox_provider.py: 156 passed. The newtest_file_transfers_retry_unanswered_requestscovers three cases:TimeoutErrorafter the configured retries.This test fails without the
provider.pychange.ruff check,ruff format --check, andpre-commit run --fileson the changed files: all clean.Local fault injection: a reverse proxy in front of the real OpenSandbox endpoint swallowed the first supervisor upload.
main, this reproduces the cluster error.Retrying OpenSandbox SDK operationwarning, then staging completes and the uploaded file compiles.Rollout evidence
mainrun, with only this change applied; job 8001464, W&B run): the job hit its 4-hour Slurm limit with 255 of 267 rollouts done. 79 supervisor uploads hung and were retried, every retry succeeded, and 0 rollouts failed (vs 52 of 267 onmain). The scored mean reward was 0.518 (vs 0.512 onmain).TimeoutError: Timed out during OpenSandbox write_file(.../process_supervisor.py) after 300s. So the stall is not HSG-only; this is the same failure this PR retries.Compatibility
No config or API changes. A stalled transfer now costs up to
operations.retries + 1attempts ofrequest_timeout_seach (300 s by default) before failing, instead of one. Shortening the per-attempt timeout for file transfers is a possible follow-up.