Skip to content

chore(source-google-ads): Update CDK with heartbeat diagnostics + add HTTP socket timeout#76315

Draft
devin-ai-integration[bot] wants to merge 8 commits intomasterfrom
devin/1776171406-google-ads-heartbeat
Draft

chore(source-google-ads): Update CDK with heartbeat diagnostics + add HTTP socket timeout#76315
devin-ai-integration[bot] wants to merge 8 commits intomasterfrom
devin/1776171406-google-ads-heartbeat

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 14, 2026

What

Updates source-google-ads to use CDK pre-release 7.13.0.post13.dev23806774478 from airbyte-python-cdk#953 to diagnose a recurring sync hang where the Google Ads source goes silent near completion (~98.6% of records read) and is eventually killed by heartbeat timeout.

Additionally adds a 5-minute HTTP socket timeout to all Google Ads API calls to prevent workers from hanging indefinitely on unresponsive API endpoints — the root cause identified from thread dump analysis of sync job 79758185 (worker stuck on ssl.recv_into() for 3.5+ hours).

Related: oncall#11852

How

  • Bumps airbyte-cdk dependency from 7.9.27.13.0.post13.dev23806774478 in pyproject.toml
  • Bumps connector version 4.2.24.2.3 in both metadata.yaml and pyproject.toml
  • Adds changelog entry
  • Adds TimeoutHTTPAdapter in components.py that enforces a 300s socket-level idle timeout via requests.adapters.HTTPAdapter
  • Mounts the adapter on HTTPS sessions in both GoogleAdsHttpRequester and CustomGAQueryHttpRequester (Google Ads API is HTTPS-only)

The CDK pre-release from PR #953 includes:

  1. Stderr heartbeat — writes diagnostic status every 30s (queue_size, queue_full, print_blocked)
  2. Automatic thread dumps — when message count is frozen for 90s, dumps all thread stack traces via sys._current_frames()
  3. Deadlock fix — non-blocking queue.put() in ConcurrentMessageRepository when called from the main thread, preventing self-deadlock on a full queue

The timeout is per-recv() call (socket idle timeout), not a total request timeout. Streaming responses that keep sending data every few seconds are unaffected — only connections where the server goes completely silent for 5+ minutes will time out. Timed-out requests are automatically retried by the CDK since requests.ReadTimeout is in TRANSIENT_EXCEPTIONS.

Review guide

  1. components.pyTimeoutHTTPAdapter class (lines 46–58) and mounting in GoogleAdsHttpRequester.__post_init__ (lines 316–319) and CustomGAQueryHttpRequester.__post_init__ (lines 864–867)
    • ⚠️ Accesses self._http_client._session (private CDK attribute) — fragile if CDK internals change
    • CustomGAQueryHttpRequester extends HttpRequester directly (not GoogleAdsHttpRequester), so timeout is added independently in both places
    • Only mounted on https://http:// was intentionally excluded to satisfy the CI "Connectors must use HTTPS only" check. Google Ads API is HTTPS-only so this is safe.
  2. pyproject.toml — CDK version bump (note: this is a pre-release version, for testing only)
  3. metadata.yaml — connector version bump
  4. docs/integrations/sources/google-ads.md — changelog entry (note: PR number in changelog references chore(source-google-ads): Update CDK with deadlock fix + HTTP socket timeout + retry on HTTP 500 #76074, should be updated to this PR's number)
  5. poetry.lock — regenerated with Poetry 1.8.5 (lock-version 2.0) vs original Poetry 2.0.1 (lock-version 2.1). Removes groups and markers metadata from package entries — verify this doesn't cause issues with CI or contributors using Poetry 2.x.

User Impact

No user-facing behavior change in normal operation. When syncs stall:

  • Stderr logs will contain diagnostic heartbeat lines and thread dumps that reveal the root cause
  • Workers stuck on unresponsive Google Ads API calls will now time out after 5 minutes instead of hanging indefinitely, allowing the sync to retry (via CDK backoff) rather than silently hang for hours

This is a testing-only change — the pre-release CDK should not be shipped to production without further validation.

Can this PR be safely reverted and rolled back?

  • YES 💚

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

… heartbeat diagnostics and deadlock fix

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@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 and CI monitoring

@octavia-bot
Copy link
Copy Markdown
Contributor

octavia-bot Bot commented Apr 14, 2026

Note

📝 PR Converted to Draft

More info...

Thank you for creating this PR. As a policy to protect our engineers' time, Airbyte requires all PRs to be created first in draft status. Your PR has been automatically converted to draft status in respect for this policy.

As soon as your PR is ready for formal review, you can proceed to convert the PR to "ready for review" status by clicking the "Ready for review" button at the bottom of the PR page.

To skip draft status in future PRs, please include [ready] in your PR title or add the skip-draft-status label when creating your PR.

@octavia-bot octavia-bot Bot marked this pull request as draft April 14, 2026 12:58
@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.
  • 🚀 Connector Releases:
    • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
  • ☕️ 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

source-google-ads Connector Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit c825034.

♻️ This comment has been updated with latest results.

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

Deploy preview for airbyte-docs ready!

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

Deployed with vercel-action

@tolik0
Copy link
Copy Markdown
Contributor

Anatolii Yatsuk (tolik0) commented Apr 14, 2026

/publish-connectors-prerelease

Pre-release Connector Publish Started

Publishing pre-release build for connector source-google-ads.
PR: #76315

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

View workflow run
Pre-release Publish: SUCCESS

Docker image (pre-release):
airbyte/source-google-ads:4.2.3-preview.f78640f

Docker Hub: https://hub.docker.com/layers/airbyte/source-google-ads/4.2.3-preview.f78640f

Registry JSON:

…worker hangs

Add TimeoutHTTPAdapter that enforces a 300s socket-level idle timeout
on all Google Ads API HTTP calls. This prevents workers from hanging
indefinitely on unresponsive API endpoints (e.g., ssl.recv_into()
blocking for hours), as observed in sync job 79758185.

The timeout is per-recv() call (not total request time), so streaming
responses that keep sending data are unaffected.

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@devin-ai-integration devin-ai-integration Bot changed the title chore(source-google-ads): Update CDK to pre-release with heartbeat diagnostics (PR #953) chore(source-google-ads): Update CDK with heartbeat diagnostics + add HTTP socket timeout Apr 15, 2026
Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@tolik0
Copy link
Copy Markdown
Contributor

Anatolii Yatsuk (tolik0) commented Apr 15, 2026

/publish-connectors-prerelease

Pre-release Connector Publish Started

Publishing pre-release build for connector source-google-ads.
PR: #76315

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

View workflow run
Pre-release Publish: SUCCESS

Docker image (pre-release):
airbyte/source-google-ads:4.2.3-preview.78ea415

Docker Hub: https://hub.docker.com/layers/airbyte/source-google-ads/4.2.3-preview.78ea415

Registry JSON:

devin-ai-integration Bot and others added 2 commits April 15, 2026 11:19
Google Ads API is HTTPS-only, so the http:// mount is unnecessary
and triggers the 'Connectors must use HTTPS only' pre-release check.

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
Reduce the HTTP socket idle timeout from 5 minutes to 2 minutes so we
can exercise the ReadTimeout path on the heartbeat-test connection and
verify that the retry/backoff behavior handles it correctly.

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Pre-release Connector Publish Started

Publishing pre-release build for connector source-google-ads.
PR: #76315

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

View workflow run
Pre-release Publish: SUCCESS

Docker image (pre-release):
airbyte/source-google-ads:4.2.3-preview.589b60c

Docker Hub: https://hub.docker.com/layers/airbyte/source-google-ads/4.2.3-preview.589b60c

Registry JSON:

Resolves conflicts in metadata.yaml, pyproject.toml, and google-ads.md
by bumping to 4.2.5 (master is at 4.2.4) and merging changelog entries.

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Pre-release Connector Publish Started

Publishing pre-release build for connector source-google-ads.
PR: #76315

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

View workflow run
Pre-release Publish: SUCCESS

Docker image (pre-release):
airbyte/source-google-ads:4.2.5-preview.6845349

Docker Hub: https://hub.docker.com/layers/airbyte/source-google-ads/4.2.5-preview.6845349

Registry JSON:

…of failing

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

Pre-release Connector Publish Started

Publishing pre-release build for connector source-google-ads.
PR: #76315

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

View workflow run
Pre-release Publish: SUCCESS

Docker image (pre-release):
airbyte/source-google-ads:4.2.6-preview.c825034

Docker Hub: https://hub.docker.com/layers/airbyte/source-google-ads/4.2.6-preview.c825034

Registry JSON:

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Devin is currently unreachable - the session may have died.

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.

2 participants