Skip to content

[Python] Fail bundles on state write errors - #39992

Draft
bvolpato wants to merge 4 commits into
apache:masterfrom
bvolpato:bvolpato/python-state-write-errors
Draft

bvolpato wants to merge 4 commits into
apache:masterfrom
bvolpato:bvolpato/python-state-write-errors

Conversation

@bvolpato

@bvolpato bvolpato commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Python runtime state commits ignore StateResponse.error, so a runner-reported write failure can still complete the bundle successfully. When an append follows a clear, the clear future is overwritten and its response is never checked.

This change checks pending write responses before completing bag, set, and ordered-list state commits, and retains both futures when an append follows a clear. Write errors fail the bundle through the existing failure handling; successful commits send the same state requests.

Local worker validation passed, and the regressions fail against the unfixed implementation. Run the Python unit suite with:

./gradlew :sdks:python:test-suites:tox:py312:testPython312

When cross-bundle user-state caching is enabled, a retry needs a runner-supplied cache token that prevents reuse of state cached by the failed bundle.


  • If this contribution is large, please file an Apache Individual Contributor License Agreement.
  • Replace these instructions with a description of your change and why you have made it.
  • Mention the appropriate issue in your description (for example: addresses #123 or fixes #456).
  • Update CHANGES.md with noteworthy changes.

See CONTRIBUTING.md for contribution guidelines.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.74%. Comparing base (76f6e6d) to head (70f308b).
⚠️ Report is 143 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #39992       +/-   ##
=============================================
+ Coverage     56.16%   79.74%   +23.57%     
=============================================
  Files          1124      487      -637     
  Lines        178336    82280    -96056     
  Branches       1489        0     -1489     
=============================================
- Hits         100170    65613    -34557     
+ Misses        75645    16667    -58978     
+ Partials       2521        0     -2521     
Flag Coverage Δ
go ?
java ?
python 79.74% <100.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant