fix(low-code): honor declared failure_type on retry filters and clean up exhaustion message - #1115
Draft
devin-ai-integration[bot] wants to merge 2 commits into
Draft
Conversation
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 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/1786551537-honor-declared-failure-type#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/1786551537-honor-declared-failure-typePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
2 tasks
PyTest Results (Fast)4 231 tests +2 4 219 ✅ +2 8m 15s ⏱️ -9s Results for commit c4686df. ± Comparison against base commit 68bc294. This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both. |
PyTest Results (Full)4 234 tests +2 4 222 ✅ +2 12m 44s ⏱️ -3s Results for commit c4686df. ± Comparison against base commit 68bc294. This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both. |
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.
Summary
Two fixes to what a user sees (and how connector health is classified) when a declarative retry budget is exhausted. Motivated by a
source-tiktok-marketingfailure that surfaced as:with
failureType: system_error.1.
HttpResponseFilterignored a declaredfailure_typeunless the action wasFAIL.APIs that signal errors as HTTP 200 with an in-body error code (TikTok Marketing, among others) have no
DEFAULT_ERROR_MAPPINGentry for 200, so aRETRYfilter always resolved tosystem_errorno matter what the manifest declared. That resolution'sfailure_typerides onDefaultBackoffExceptionand is reused when retries are exhausted (http_client.py:317-323, propagation added in #762) — so the CDK was already designed to honor a declaredfailure_type; the declarative filter simply never supplied one for non-FAILactions.IGNOREandRESET_PAGINATIONdeliberately keep the previous default-mapping behavior:IGNOREemits no failure downstream (only a log line), so there is no reason to change its semantics here.2. The retry-exhaustion
messagereplayed retry-phase narration.The old string interpolated the retry-phase
error_messageverbatim, which is how "The connector will retry automatically" ended up in a message emitted after retries were exhausted, and it also carried remediation text.internal_messageis unchanged and still contains the full exception detail (including the vendor error text), so nothing is lost for debugging. Follows the writing-good-error-messages guidelines.Blast radius / breaking-change assessment
This is opt-in: behavior only changes for manifests that already declare a
failure_typenext to a non-FAILaction. Greppingairbytehq/airbyte, that's 7 connectors today, and all of them declare exactly what they'd now get:source-slack,source-pinterest,source-hubspot—RATE_LIMITED/RETRY:transient_errorsource-intercom—RETRY:transient_error(itsIGNORE/RESET_PAGINATIONdeclarations are unaffected)source-apple-search-ads—REFRESH_TOKEN_THEN_RETRY:transient_error(8 declarations)source-hubspot—REFRESH_TOKEN_THEN_RETRY:config_errorsource-linear—RATE_LIMITED:transient_errorsource-zendesk-support— onlyIGNOREdeclarations, unaffectedI don't believe this is a breaking change under the connector breaking-change rules: no spec, schema, state, or stream-scope change, and no records are added or dropped. What changes is the
FailureTypelabel and the user-facingmessageon an already-failing sync — some previously-system_errorfailures now report as whatever the manifest declares (typicallytransient_error), which is the intended correction. Downstream consumers that key off the exact old exhaustion string would see a different string; that string was not a documented interface.Testing
HttpResponseFilter: declaredfailure_typeis honored onRETRY; a declaredfailure_typeonIGNOREstill resolves from the default mapping (asserts the deliberate carve-out).HttpClient: end-to-end retry exhaustion through a declarativeRETRYfilter that declarestransient_error— asserts the resultingFailureType, the exact user-facingmessage, and that the retry-phase detail is preserved ininternal_message.test_http_response_filter.py): it asserted that a declaredconfig_erroron aRETRYfilter resolved to the default instead of the declaration. That expectation encoded the bug, so it now asserts the declared value.pyteston the affected files (72 passed) plus the broader declarative error-handler andstreams/httpsuites (559 passed);ruff check,ruff format --check, andmypyclean.Related to https://github.com/airbytehq/oncall/issues/13291:
A companion PR in
airbytehq/airbyterewords thesource-tiktok-marketingretry filter messages and declaresfailure_type: transient_erroron them; the declaration only takes effect once asource-declarative-manifestbase image ships this CDK change.Link to Devin session: https://app.devin.ai/sessions/052578ae518045c88abdfe6311014bc7