Repository navigation
fix(cdk): stop labeling every user-defined backoff as a rate limit in retry logs - #1250
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… retry logs Co-Authored-By: bot_apk <apk@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1792771896-neutral-user-backoff-log#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1792771896-neutral-user-backoff-logPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
|
🙋 Escalating per Hands-Free AI Triage Project triage next step. Reason: this draft CDK PR has had green required CI since 2026-10-23 with no further activity, and |
Overview
👉 TL;DR: When a connector waits before retrying a failed request, the CDK logged "Rate limit exceeded" no matter why the request failed — including plain server errors — which led a customer and support to think a GitHub quota was exhausted. The log line now says why it is waiting and only mentions a rate limit for HTTP 429, with the wait rounded to one decimal.
user_defined_backoff_handler.sleep_on_ratelimitinrate_limiting.pynow logs e.g.Backing off for 2911.8 seconds after HTTP 500 response (attempt 1), then retrying.instead ofUserDefinedBackoffException: Rate limit exceeded (HTTP 500). Retrying in 2911.8324723243713 seconds.Resolves https://github.com/airbytehq/oncall/issues/13838:
Close on merge: yes — internally filed, no customer to confirm with.
Related to https://github.com/airbytehq/oncall/issues/13837:
Changes
airbyte_cdk/sources/streams/http/rate_limiting.py:sleep_on_ratelimitpicks the log line by cause:Rate limit exceeded (HTTP 429). Backing off for {wait} seconds (attempt {n}), then retrying.Backing off for {wait} seconds after HTTP {status} response (attempt {n}), then retrying.Backing off for {wait} seconds after a request error (attempt {n}), then retrying.{wait}is formatted:.1f; the actualtime.sleep(retry_after + 1)value is unchanged.unit_tests/sources/streams/http/test_rate_limiting.pyasserting the exact log line for 500, 429, and aReadTimeout, and that the sleep value is not rounded.Not changed / related PRs
FailureTypebehavior changes; log text only.http_client.pyexhausted-retries messages are intentionally untouched to avoid conflicts with open PRs that edit those lines: fix(cdk): improve rate limiting error messages to suggest reducing num_workers #949 (drops "Please see logs" and rewords rate-limit messages), fix(cdk): name the stream in the rate-limit-exhausted error message #1242 (names the stream in the 429-exhausted message), fix(http): classify body-coded rate-limit exhaustion as transient_error #1087 (body-coded rate-limit classification). Prior related change: fix: suppress misleading backoff library log in user_defined_backoff_handler #981 (suppressed the misleadingbackofflibrary log in this same handler).X-RateLimit-Resetapplied to all retryable responses) is out of scope and tracked in airbytehq/oncall#13837.Test Coverage
New parametrized test fails on
main(logsUserDefinedBackoffException: Rate limit exceeded (HTTP 500). Retrying in 2911.8324723243713 seconds.) and passes with the fix.unit_tests/sources/streams/http/passes locally (536 passed); ruff and mypy clean.Pre-fix test output
Show/Hide Content
Link to Devin session: https://app.devin.ai/sessions/e2baef250f524c608deead0a3eca669e
Open in Devin Desktop: https://app.devin.ai/desktop/session/e2baef250f524c608deead0a3eca669e?variant=devin