Repository navigation
sdk/python: rebind find_iter after an owner moves - #484
Merged
Merged
Conversation
…Seq does A moved owner shows only at the dial or the upgrade reply, both before the first frame, so a retry replays no match. find_iter opens through _open_stream, which already follows one move, and find drops its own decorator.
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.
After a sandbox moves, a direct
find_iter()call still targets the old owner on every retry. Unlikefind(), the iterator never called_rebind, leaving the handle stale after an owner 404 or refused connection. This closes the P2 found after #483.find_iter()now opens its stream through the existing_open_stream, which follows one move: on an owner 404 or a refused connection it looks the sandbox up and retries once at the new owner, as the GoFindSeqdoes throughretryMoved. A moved owner shows only at the dial or the upgrade reply, both before the first frame, so the retry replays no match.find()collectsfind_iter()and drops its own_follows_move, so a call still makes one lookup and one retry at most._open_streamwith an emptyexpectreturns the first frame of any type.The regression uses in-process fake nodes and the existing relay fixture, with no sleeps or timing assertions. It covers both owner 404 and connection refusal, for
find_iter()andfind(): the first call returns the matches from the new owner, with one lookup and one upgrade there.Validation on Python 3.12:
find_iter: bothfind_itercases fail; bothfindcases pass.ruff format --check .andruff check .: passed.python -m mypy: passed, 11 source files.git diff --check: passed.LOC: production +7/-6 (net +1); tests +22. No dependencies or public API changes. No hardware migration run; this validates the SDK routing and retry boundary.