[Python] Fail bundles on state write errors - #39992
Draft
bvolpato wants to merge 2 commits into
Draft
Conversation
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.
A runner-reported append or clear failure can currently complete a Python bundle successfully because runtime state commits ignore
StateResponse.error. A clear followed by an append also loses the clear response.Check every pending write response before completing bag, set, and ordered-list state commits, and preserve both futures for clear-then-append. Regression tests cover failed appends and clears, multiple append chunks, set compaction, and successful commits. The new tests fail against the upstream implementation.
Testing
From
sdks/python, with the SDK and test dependencies installed:Python 3.12: 45 passed, plus 15 subtests passed. The new regression cases produced 15 failures against the unfixed implementation. YAPF 0.43.0, Ruff 0.15.22, and
git diff --checkpass for the changed files.Downsides
Previously hidden backend failures now fail the bundle and invoke the runner's existing failure/retry handling. The successful path adds no state RPCs. Retry uses the existing runner contract that failed state handlers must not reuse their cache token.
CHANGES.mdwith the behavior change.See the Contributor Guide and CI documentation.