fix(airflow-client): retry writes on transient 5xx and make copy operations idempotent - #2171
Merged
Conversation
Coverage Report for CI Build 28068617702Coverage increased (+0.02%) to 45.301%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
sakethsomaraju
marked this pull request as ready for review
June 15, 2026 05:15
wendtek
reviewed
Jun 15, 2026
schnie
approved these changes
Jun 23, 2026
neel-astro
reviewed
Jun 29, 2026
neel-astro
left a comment
Contributor
There was a problem hiding this comment.
I don't think the PR is solving the double dash problem in the URL, for that you would need to fix the url path escape the variable key when building the URL.
neel-astro
approved these changes
Jun 30, 2026
neel-astro
pushed a commit
that referenced
this pull request
Jun 30, 2026
…ations idempotent (#2171) Co-authored-by: Saketh Somaraju <sakethsomaraju@Sakeths-MacBook-Pro.local>
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.
Description
Fixes an issue that could leave a preview deployment in a permanently broken, partially-configured state after a transient network failure during airflow-variable copy, connection copy, or pool copy.
No retry on transient write failures
The CLI used retryablehttp for GET requests but not for write operations. A single transient 503 mid-copy caused the entire command to fail with no recovery, leaving the destination with only a partial set of variables/connections/pools.
Changes
Retry policy (checkRetryPolicy):
GET requests: unchanged (default policy)
Non-GET (writes): retry only on 502, 503, 429, cases where the server provably did not apply the write. Transport errors, 500, and 504 are not retried as these are ambiguous (write may have already been applied)
Write retries use a separate budget: 3 attempts with 5s backoff
Operation-layer idempotency (CreateVariable, CreateConnection, CreatePool):
Each create operation is now an upsert: on 409 Conflict, falls back to the corresponding PATCH update
Makes the entire copy command safe to re-run after any partial failure, existing resources get updated, missing ones get created
🎟 Issue(s)
Closes #2172
🧪 Functional Testing
📸 Screenshots
To reproduce the 503 responses, I force-deleted the webserver and confirmed that the webserver container came back online within 15 seconds.
In the 1.42.1 version.
After fix:
📋 Checklist
make testbefore taking out of draftmake lintbefore taking out of draft