Skip to content

fix(destination-bigquery): surface interrupted standard-inserts operations as transient errors - #83276

Draft
devin-ai-integration[bot] wants to merge 4 commits into
masterfrom
devin/1785468672-bigquery-standard-inserts-interrupt
Draft

fix(destination-bigquery): surface interrupted standard-inserts operations as transient errors#83276
devin-ai-integration[bot] wants to merge 4 commits into
masterfrom
devin/1785468672-bigquery-standard-inserts-interrupt

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

What

Resolves https://github.com/airbytehq/oncall/issues/13206:

When a sync is cancelled/torn down (e.g. because the source failed — in the reported job it was a HubSpot 401), the destination's direct-load worker thread is interrupted while inside BigqueryBatchStandardInsertsLoader.switchToWriteChannel(). The BigQuery SDK wraps the interrupt in BigQueryException(cause=InterruptedException), and the loader rethrew it as a brand-new BigQueryException(e.code, e.message) — dropping the cause. The bulk CDK's DefaultExceptionClassifier then falls through to SystemError, so users see a raw java.lang.InterruptedException classified as system_error (Sentry: https://airbytehq.sentry.io/issues/7643588179/).

How

  • Added BigQueryUtils.executeBigQueryOperation { ... }: catches BigQueryException, walks the full cause chain for InterruptedException; if found, restores the thread interrupt flag and throws TransientErrorException("The BigQuery operation was interrupted, likely because the sync was cancelled. ...", cause = original). Same semantics as the utility introduced in the (still-open) fix(destination-bigquery): handle InterruptedException during sync cancellation #79168, so the two changes merge cleanly.
  • Wrapped all blocking BigQuery calls in BigqueryBatchStandardInsertsLoader with the utility: bigquery.writer(...), writer.write(...) (both call sites), writer.close(), BigQueryUtils.waitForJobFinish(...), writer.job.reload().
  • switchToWriteChannel() keeps 403/404 → ConfigErrorException unchanged, and now preserves the original exception as cause when rethrowing other BigQueryExceptions: BigQueryException(e.code, e.message, e).

Review guide

  1. BigQueryUtils.kt — new executeBigQueryOperation() utility
  2. write/standard_insert/BigqueryBatchStandardInsertLoader.kt — wrapped blocking calls, cause preservation
  3. BigQueryUtilsExecuteBigQueryOperationTest.kt — utility unit tests (nested cause chain, interrupt flag, passthrough)
  4. write/standard_insert/BigqueryBatchStandardInsertsLoaderTest.kt — loader tests: interrupt → TransientErrorException, 403/404 → ConfigErrorException unchanged, cause preserved on other errors
  5. metadata.yaml / docs/integrations/destinations/bigquery.md — version bump to 3.0.24-rc.1 (progressive rollout enabled) + changelog

Declarative-First Evaluation

Not applicable — this is a Java/Kotlin bulk-load connector, not a declarative/manifest connector.

Test Coverage

New unit tests cover the interruption conversion (including nested cause chains and interrupt-flag restoration), the unchanged 403/404 config-error path, and cause preservation for other BigQuery errors. Local Gradle runs were blocked by Maven Central HTTP 429 rate limiting during dependency resolution; relying on CI unit tests for execution.

User Impact

An interrupted BigQuery operation during sync teardown now surfaces as a transient error with a readable message instead of a raw java.lang.InterruptedException classified as system_error. Reduces Sentry noise; no behavior change for real config or system errors.

Can this PR be safely reverted and rolled back?

  • YES 💚

Link to Devin session: https://app.devin.ai/sessions/9da8f5a89a5c472083d9203bec6c5d3d

devin-ai-integration Bot and others added 2 commits July 31, 2026 03:32
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown
Contributor

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • 🛠️ Quick Fixes
    • /format-fix - Fixes most formatting issues.
    • /bump-version - Bumps connector versions, scraping changelog description from the PR title.
      • Bump types: patch (default), minor, major, major_rc, rc, promote.
      • The rc type is a smart default: applies minor_rc if stable, or bumps the RC number if already RC.
      • The promote type strips the RC suffix to finalize a release.
      • Example: /bump-version type=rc or /bump-version type=minor
    • /bump-progressive-rollout-version - Alias for /bump-version type=rc. Bumps with an RC suffix and enables progressive rollout.
  • ❇️ AI Testing and Review (internal link: AI-SDLC Docs):
    • /ai-prove-fix - Runs prerelease readiness checks, including testing against customer connections.
    • /ai-canary-prerelease - Rolls out prerelease to 5-10 connections for canary testing.
    • /ai-review - AI-powered PR review for connector safety and quality gates.
  • 📝 AI Documentation:
    • /ai-docs-review - AI-powered documentation review for PRs with connector changes.
    • /ai-create-docs-pr - Creates a documentation PR for connector changes, stacked on the current PR.
  • 🚀 Connector Releases:
    • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
    • /enable-autopilot-rollouts - Enables autopilot progressive rollouts for the modified connector(s) in the PR, remediating "autopilot rollouts not enabled for {connector-name}" auto-merge blockers. Sets defaultRolloutMode: autopilot and enableProgressiveRollout: true, preserving any existing autopilotConfig.
      • Optional args: connector=<CONNECTOR_NAME> (defaults to the modified connectors in the PR), strategy=fast|slow|default (defaults to fast).
      • Example: /enable-autopilot-rollouts or /enable-autopilot-rollouts connector=source-faker strategy=slow
  • ☕️ JVM connectors:
    • /update-connector-cdk-version connector=<CONNECTOR_NAME> - Updates the specified connector to the latest CDK version.
      Example: /update-connector-cdk-version connector=destination-bigquery
  • 🐍 Python connectors:
    • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
    • /poe source example lock - Alias for /poe connector source-example lock.
    • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
    • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.
  • ⚙️ Admin commands:
    • /force-merge reason="<REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.
      Example: /force-merge reason="CI is flaky, tests pass locally"
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

Co-Authored-By: bot_apk <apk@cognition.ai>
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for airbyte-docs ready!

Project:airbyte-docs
Status: ✅  Deploy successful!
Preview URL:https://airbyte-docs-eonc4wprm-airbyte-growth.vercel.app
Latest Commit:60ac12c

Deployed with vercel-action

Co-Authored-By: bot_apk <apk@cognition.ai>
@github-actions

Copy link
Copy Markdown
Contributor

destination-bigquery Connector Test Results

470 tests   419 ✅  1h 49m 49s ⏱️
 24 suites   51 💤
 24 files      0 ❌

Results for commit 60ac12c.

@airbyte-support-bot

Copy link
Copy Markdown
Contributor

↪️ Triggering /ai-prove-fix per Hands-Free AI Triage Project triage next step.

Reason: Draft /ai-fix PR for the BigQuery InterruptedException Sentry issue with all CI checks green and no prove-fix run yet; validating the fix is the next pipeline stage:

Devin session

@octavia-bot

octavia-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Prove Fix session starting... Running readiness checks and testing against customer connections. View playbook

Devin AI session created successfully!

@airbyte-support-bot

Airbyte Support Bot (airbyte-support-bot) commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🧪 Fix Validation Evidence

⚪ Outcome: Could Not Test (live validation pending human approval)

Pre-flight checks passed and pre-release 3.0.24-preview.60ac12c was published successfully. Live-connection validation on an internal sandbox connection is fully prepared, but connection pinning requires human approval, which has not yet been granted (~2h wait). The strongest evidence currently available is the PR's new unit tests (green in CI), which directly cover the interrupt→TransientErrorException conversion, interrupt-flag restoration, unchanged 403/404 config-error handling, and cause preservation.

🚦 Next Steps
  1. An authorized team member can approve the pending pin request in the #human-in-the-loop Slack channel — I will then run the live validation (baseline sync + cancelled sync on an internal sandbox connection) and update this report.
  2. Alternatively, since the fix only triggers on sync teardown/cancellation (an edge path that healthy syncs never exercise), reviewers may rely on the unit-test coverage plus the progressive rollout (3.0.24-rc.1 with rollout enabled) to monitor real-world behavior after merge.
  3. The daily_hands_free_triage automation will monitor the release rollout after merge.

📋 Connector & PR Details

Connector: destination-bigquery
PR: #83276
Pre-release Version Tested: 3.0.24-preview.60ac12c (published, not yet deployed to any connection)
Comparison Baseline: N/A — regression tests unsupported for destinations
Detailed Results: https://github.com/airbytehq/oncall/issues/13206#issuecomment-5143778591

📝 Evidence Plan

Proving Criteria

A cancelled/interrupted sync on the pre-release surfaces the new message "The BigQuery operation was interrupted, likely because the sync was cancelled..." classified as transient_error, instead of a raw java.lang.InterruptedException classified as system_error; and a normal sync completes with no behavior change.

Disproving Criteria

Interrupted syncs still surface raw InterruptedException as system_error, or normal syncs fail/regress on the pre-release.

Cases Attempted

  1. Internal sandbox connection (Faker → BigQuery, standard inserts) — qualified and ready, but pinning blocked pending HITL approval.
✅ Pre-flight Checks
  • Viability: Fix addresses the reported issue (cause chain dropped → system_error misclassification)
  • Safety: No malicious code or dangerous patterns
  • Breaking Change: No breaking changes (patch-level RC bump; no schema/spec/state changes)
  • Pin Exclusion: Candidate connection verified unpinned (exclude_pinned=True + direct pin check)
  • Reversibility: Safely revertible; changelog present
📊 Detailed Evidence Log
  • 11:39 UTC — Pre-release publish triggered; publish job succeeded (workflow run).
  • 11:44 UTC — Evidence plan posted; candidate internal connection qualified (details in the linked private issue).
  • 11:45 UTC — HITL approval requested via Slack (#human-in-the-loop) for pinning the internal sandbox connection.
  • ~13:55 UTC — No approval received; posting interim report. Will resume and update if approval lands.
  • Regression tests: not applicable — the regression test harness supports source connectors only; destination-bigquery is a destination.
  • Unit-test evidence (CI green): interrupt in nested cause chain → TransientErrorException with original exception as cause + interrupt flag restored; non-interrupt BigQueryException passthrough; 403/404 → ConfigErrorException unchanged; cause preserved on rethrow.

Note: Connection IDs and detailed logs are recorded in the linked private issue.

@airbyte-support-bot Airbyte Support Bot (airbyte-support-bot) added the hyd-prove Hydra: ai-prove-fix stage has run label Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Pre-release Connector Publish Started

Publishing pre-release build for connector destination-bigquery.
PR: #83276

Pre-release versions will be tagged as {version}-preview.60ac12c
and are available for version pinning via the scoped_configuration API.

View workflow run
Pre-release Publish: SUCCESS

Docker image (pre-release):
airbyte/destination-bigquery:3.0.24-preview.60ac12c

Docker Hub: https://hub.docker.com/layers/airbyte/destination-bigquery/3.0.24-preview.60ac12c

Registry JSON:

@airbyte-support-bot

Copy link
Copy Markdown
Contributor

🙋 Escalating to a human via #human-in-the-loop per Hands-Free AI Triage Project triage next step.

Reason: /ai-prove-fix closed as ⚪ Could Not Test: pre-flight passed and pre-release 3.0.24-preview.60ac12c published, and live-connection validation on an internal sandbox connection is fully prepared, but pinning the connection requires human approval that has not been granted after roughly two hours. This is a human gate rather than a pipeline gate, so it needs an approver rather than another automated attempt. The evidence available without it is the PR's new unit tests, green in CI, which cover the interrupt → TransientError path directly. Routing to the database and data warehouse connectors oncall group. Linked issue: https://github.com/airbytehq/oncall/issues/13206

Devin session

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

Labels

connectors/destination/bigquery hyd-fix Hydra: ai-fix stage has run hyd-prove Hydra: ai-prove-fix stage has run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants