Repository navigation
CLI: wait out a deploy's 502s for requests safe to repeat - #78
Merged
Merged
Conversation
A deploy on weft used to give about 60 s of 502s, and even with blue/green there's a moment of switching. The API client now tries a GET or an estimate again after 1, 2, 4 and 8 s when the proxy answers 502/503/504, and any request that couldn't connect (nothing reached Krater). A submit or other change that gets a 502 is never sent again: Krater may already have queued it. `wait` and `logs -f` keep their own longer patience on top. `run` passes its injectable sleep to the client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part of zero-downtime deploys (with #76 and patchworklabsorg/infra#103, #104): the
kraterCLI waits out the moment a deploy switches releases.POST …/jobs/estimate) that gets 502, 503 or 504 from the proxy is retried after 1, 2, 4 and 8 s (about 15 s in all), with one "trying again" line on stderr.krater jobsfirst.waitandlogs -fkeep their own longer patience on top.runpasses its injectablesleepto the client, so tests don't sleep for real.Tests: new
cli/tests/test_api_retry.pycovers a read waiting out a deploy, the estimate, a submit not repeated after a 502, a refused connection repeated, giving up after 4 retries, and a 404 not retried. Twowait/logs -ftests were updated: the client now absorbs the 5xx and the refused connection first. All 170 CLI tests pass.🤖 Generated with Claude Code