fix: add timeout to Zoho CRM OAuth token refresh request - #84238
fix: add timeout to Zoho CRM OAuth token refresh request#84238Bunlong Heng (bunlongheng) wants to merge 1 commit into
Conversation
|
|
|
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 |
👋 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 TricksPR Slash CommandsAs needed or by request, Airbyte Maintainers can execute the following slash commands on your PR:
Tips for Working with CI
📚 Show Repo GuidanceHelpful Resources
|
What
ZohoOauth2Authenticator.refresh_access_token()insource-zoho-crm/source_zoho_crm/auth.pycallsrequests.request("POST", url, params=...)without atimeout. Python'srequestshas 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 = 60constant and passtimeout=TOKEN_REFRESH_TIMEOUTto the request. A stalled endpoint now raises aTimeoutafter 60 seconds, which is caught by the existingexceptblock and surfaced as an error instead of hanging forever. Minimal change, no API or behavior change on the success path.Test
requests.exceptions.Timeoutafter 60s rather than blocking indefinitely.(access_token, expires_in)tuple is identical.