fix: task cancelation race + RLM sandbox workers#1035
Open
Conversation
Comment on lines
+147
to
148
| self.request_tasks[frame_request_id] = task | ||
| self.pending_tasks.add(task) |
Member
There was a problem hiding this comment.
i know not part of this pr but would it make sense to merge those two dicts to avoid future races?
| except Exception: | ||
| pass | ||
|
|
||
| async def _upload_file_with_retry( |
Member
There was a problem hiding this comment.
should we make this part of sandbox nixon so all envs get the benefits?
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.
Description
Fix a missed-cancel race in the ZMQ env server and make RLM sandbox upload+download failures fail as vf.SandboxError.
Changes
Why
This stops stale cancelled rollouts from continuing invisibly and makes exhausted sandbox transfer failures follow the normal rescheduleable sandbox-error path.
Testing
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Note
Medium Risk
Changes request-task tracking and cancellation behavior in
ZMQEnvServer, plus adds retry/wrapping around RLM sandbox upload/download operations; mistakes could lead to leaked tasks or masked sandbox transfer failures.Overview
Fixes a client-cancel race in
ZMQEnvServerby registering per-request tasks at creation time and centralizing task cleanup, ensuring cancel signals can’t miss the pre-registration window.Hardens RLM sandbox file transfers by introducing shared retry predicates for transient sandbox/API read errors, threading sandbox client pool settings from
RLMEnvintoRLMExecutor, and retrying upload/download operations with failures surfaced asvf.SandboxErroraftersandbox_transfer_max_retries.Adds targeted regression tests covering the pre-processing cancel race, retryable sandbox error classification, executor client pool configuration wiring, and upload-timeout retry behavior.
Written by Cursor Bugbot for commit 0ee0546. This will update automatically on new commits. Configure here.