Repository navigation
[BugFix] Make async recv timeout bound the whole call - #4184
Merged
Merged
Conversation
The timeout of async_step_recv / async_step_and_maybe_reset_recv / async_reset_recv only bounded the max_get top-up phase: the wait for the first result and the min_get phase used blocking, timeout-less gets, so recv(min_get=1, timeout=...) could block forever. The deadline is now anchored at call entry and covers the entire call on all three paths (queue exchange, shm exchange, threading futures): - If fewer than min_get results arrive before the deadline, a TimeoutError is raised. No result is lost: the multiprocessing paths requeue the partial harvest, the threading path leaves completed futures in the pool's pending lists, and pending-result accounting is only updated on success. - Once min_get is satisfied, the call returns at the deadline with whatever is ready (up to max_get), including a final non-blocking drain at expiry. - timeout=0 is a non-blocking poll; timeout=None is unchanged. Adds docstrings for the recv contract, restructures the two deadline tests that encoded the old semantics, and adds a regression test asserting both the TimeoutError and the no-result-lost guarantee. The API is unreleased (#4109, post v0.13.3), so this is a plain behavior fix with no deprecation cycle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4184
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
No description provided.