Skip to content

fix: add timeout to Zoho CRM OAuth token refresh request - #84238

Draft
Bunlong Heng (bunlongheng) wants to merge 1 commit into
airbytehq:masterfrom
bunlongheng:fix-zoho-crm-token-refresh-timeout-sec
Draft

fix: add timeout to Zoho CRM OAuth token refresh request#84238
Bunlong Heng (bunlongheng) wants to merge 1 commit into
airbytehq:masterfrom
bunlongheng:fix-zoho-crm-token-refresh-timeout-sec

Conversation

@bunlongheng

Copy link
Copy Markdown

What

ZohoOauth2Authenticator.refresh_access_token() in source-zoho-crm/source_zoho_crm/auth.py calls requests.request("POST", url, params=...) without a timeout. Python's requests has no default timeout, so this call can block forever.

This method overrides the airbyte-cdk Oauth2Authenticator, which normally issues its token refresh request with a timeout. The override dropped it.

Why it matters

refresh_access_token() runs at the start of (and periodically during) every sync. The token endpoint URL is derived from the user-configured Zoho region/environment. If that endpoint hangs, is slow, or is silently dropped by a firewall or proxy, the sync thread blocks indefinitely with no error and no retry - a hung connection stalls the whole connector until the process is killed. This is a reliability/availability defect that a network-level stall can trigger.

Fix

Add a module-level TOKEN_REFRESH_TIMEOUT = 60 constant and pass timeout=TOKEN_REFRESH_TIMEOUT to the request. A stalled endpoint now raises a Timeout after 60 seconds, which is caught by the existing except block and surfaced as an error instead of hanging forever. Minimal change, no API or behavior change on the success path.

Test

  • A slow/non-responding token endpoint now raises requests.exceptions.Timeout after 60s rather than blocking indefinitely.
  • Normal refreshes complete unchanged; the returned (access_token, expires_in) tuple is identical.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@octavia-bot
octavia-bot Bot marked this pull request as draft August 11, 2026 19:05
@octavia-bot

octavia-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Welcome to Airbyte!

Thank you for your contribution from bunlongheng/airbyte! We're excited to have you in the Airbyte community.

If you have any questions, feel free to ask in the PR comments or join our Slack community.

💡 Show Tips and Tricks

PR Slash Commands

As needed or by request, Airbyte Maintainers can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
  • /run-connector-tests - Runs connector tests.
  • /run-cat-tests - Runs CAT tests.
  • /run-regression-tests - Runs regression tests for the modified connector(s).
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
  • /ai-review - AI-powered PR review for connector safety and quality gates.
  • /ai-docs-review - AI-powered documentation review for PRs with connector changes.
  • /ai-create-docs-pr - Creates a documentation PR for connector changes.
  • /force-merge reason="<A_GOOD_REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.

Tips for Working with CI

  1. Pre-Release Checks. Please pay attention to these, as they contain standard checks on the metadata.yaml file, docs requirements, etc. If you need help resolving a pre-release check, please ask a maintainer.
    • Note: If you are creating a new connector, please be sure to replace the default logo.svg file with a suitable icon.
  2. Connector CI Tests. Some failures here may be expected if your tests require credentials. Please review these results to ensure (1) unit tests are passing, if applicable, and (2) integration tests pass to the degree possible and expected.
  3. (Optional.) BYO Connector Credentials for tests in your fork. You can optionally set up your fork with BYO credentials for your connector. This can significantly speed up your review, ensuring your changes are fully tested before the maintainers begin their review.
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

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

Projects

Development

Successfully merging this pull request may close these issues.

3 participants