You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "bvolpato (via GitHub)" <gi...@apache.org> on 2026/09/03 18:08:02 UTC

[PR] [Python] Reset BigQuery retries for each batch [beam]

bvolpato opened a new pull request, #39995:
URL: https://github.com/apache/beam/pull/39995

   BigQuery streaming inserts share one retry iterator across an entire bundle and advance it even for successful requests. With `max_retries=1`, a successful batch exhausts the retry budget for the next batch: a transient failure then goes straight to the failed-row output. Prior successes also inflate the initial backoff for later batches; after 20 successful batches it reaches 750–1500 seconds.
   
   Create the retry iterator per batch, matching the documented per-group retry limit. Partial-failure retries still preserve the failed rows and their insert IDs. Tests cover consecutive batches, different destinations, a previously exhausted batch, initial backoff, and zero retries.
   
   ## Testing
   
   From `sdks/python`, with the SDK and GCP test dependencies installed:
   
   ```sh
   python -m pytest apache_beam/io/gcp/bigquery_test.py -q \
     -k 'successful_batches or exhausted_batch or zero_retries'
   ```
   
   All 5 new cases pass. Against the upstream implementation, 4 fail and the zero-retry compatibility case passes.
   
   All 50 tests in the three affected streaming test classes also pass on Python 3.12. Credential discovery was stubbed only in the test process; the tests' existing request/client mocks remain in use:
   
   ```python
   from unittest import mock
   import pytest
   from google.auth.credentials import AnonymousCredentials
   
   with mock.patch('google.auth.default',
                   return_value=(AnonymousCredentials(), 'test-project')):
       raise SystemExit(pytest.main([
           '-q', '--timeout=30',
           'apache_beam/io/gcp/bigquery_test.py::BigQueryStreamingInsertTransformTests',
           'apache_beam/io/gcp/bigquery_test.py::BigQueryStreamingInsertsErrorHandling',
           'apache_beam/io/gcp/bigquery_test.py::PipelineBasedStreamingInsertTest',
       ]))
   ```
   
   The full module encountered an unrelated credential-lock failure in an existing read test, also reproduced on upstream. YAPF 0.43.0, Ruff 0.15.22, and `git diff --check` pass for the changed files.
   
   ## Downsides
   
   The retry allowance now applies independently to each batch, so several failing batches can make more total attempts than the previous accidental shared limit. The configured per-batch limit remains unchanged.
   
   ------------------------
   
   - [x] Describe the bug and include reproducible regression tests.
   - [x] Update `CHANGES.md` with the behavior change.
   - [ ] Apache Individual Contributor License Agreement, if required for this contribution.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Python] Reset BigQuery retries for each batch [beam]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #39995:
URL: https://github.com/apache/beam/pull/39995#issuecomment-6105294144

   ## [Codecov](https://app.codecov.io/gh/apache/beam/pull/39995?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 56.23%. Comparing base ([`76f6e6d`](https://app.codecov.io/gh/apache/beam/commit/76f6e6d7c0c1b2ce582c73d068ad9260cf15c5f3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3f16104`](https://app.codecov.io/gh/apache/beam/commit/3f16104d4ab7c8ee7c53d3d88a535ea27873373e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 111 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #39995      +/-   ##
   ============================================
   + Coverage     56.16%   56.23%   +0.06%     
     Complexity     2288     2288              
   ============================================
     Files          1124     1124              
     Lines        178336   178359      +23     
     Branches       1489     1489              
   ============================================
   + Hits         100170   100293     +123     
   + Misses        75645    75545     -100     
     Partials       2521     2521              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/beam/pull/39995/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [python](https://app.codecov.io/gh/apache/beam/pull/39995/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `79.68% <100.00%> (+0.12%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/beam/pull/39995?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Python] Reset BigQuery retries for each batch [beam]

Posted by "bvolpato (via GitHub)" <gi...@apache.org>.
bvolpato commented on PR #39995:
URL: https://github.com/apache/beam/pull/39995#issuecomment-5531811481

   I checked the failed wheel job: the wheel built, auditwheel repair completed, and the result was copied out. The failure came afterward in cibuildwheel's Docker cleanup, where a container command timed out after 30 seconds. The 50 affected BigQuery streaming tests also pass locally.
   
   Could someone with rerun access retry [the failed wheel job](https://github.com/apache/beam/actions/runs/33788749169/job/100760886147)? My fork account cannot rerun upstream Actions. Thanks!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Python] Reset BigQuery retries for each batch [beam]

Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm merged PR #39995:
URL: https://github.com/apache/beam/pull/39995


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Python] Reset BigQuery retries for each batch [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39995:
URL: https://github.com/apache/beam/pull/39995#issuecomment-6105040200

   Assigning reviewers:
   
   R: @claudevdm for label python.
   
   
   Note: If you would like to opt out of this review, comment `assign to next reviewer`.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org