Skip to content

feat(bigquery): handle duplicate job error with jobs.insert - #6799

Merged
alvarowolfx merged 3 commits into
googleapis:mainfrom
alvarowolfx:feat-bq-retry-409-jobs-insert
Sep 15, 2026
Merged

alvarowolfx merged 3 commits into
googleapis:mainfrom
alvarowolfx:feat-bq-retry-409-jobs-insert

Conversation

@alvarowolfx

Copy link
Copy Markdown
Contributor

A transport/io error can happen after query was inserted and RPC level retries might try to re-insert it with same job ID. Instead of re running the query, we can connect to the existing one to avoid running and billing a new query.

Towards #6218 #6717

@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Sep 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces handling for duplicate job errors during BigQuery query execution. When a duplicate job error is encountered, the client now attempts to adopt the existing job instead of failing. This is achieved by retrieving the existing job and checking its status. Additionally, the PR includes comprehensive unit tests to verify this new behavior. I have no further feedback to provide as there are no review comments.

@alvarowolfx
alvarowolfx marked this pull request as ready for review September 14, 2026 18:16
@alvarowolfx
alvarowolfx requested a review from a team as a code owner September 14, 2026 18:16
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.02%. Comparing base (8fb991a) to head (2860a3d).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
src/bigquery/src/query/execution.rs 97.89% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6799      +/-   ##
==========================================
- Coverage   97.03%   97.02%   -0.01%     
==========================================
  Files         326      326              
  Lines      107511   107597      +86     
==========================================
+ Hits       104322   104399      +77     
- Misses       3189     3198       +9     

☔ 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.

Comment thread src/bigquery/src/query/execution.rs Outdated
@alvarowolfx
alvarowolfx merged commit ec54ef0 into googleapis:main Sep 15, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants