Repository navigation
fix(cdk): stop labeling every user-defined backoff as a rate limit in retry logs - #1250
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… retry logs Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
|
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:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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