Skip to content

fix(deploy): settle in-flight replaces and back off between recovery retries#4985

Draft
rianmcguirefly wants to merge 1 commit into
masterfrom
rm/deploy-retry-settle
Draft

fix(deploy): settle in-flight replaces and back off between recovery retries#4985
rianmcguirefly wants to merge 1 commit into
masterfrom
rm/deploy-retry-settle

Conversation

@rianmcguirefly

Copy link
Copy Markdown
Member

The recovery retry loop re-issued updates over every still-differing machine with no wait for the prior operation to settle and a fixed 1s backoff. Against a fast-restarting / mid-replace app this stacked a fresh update on top of an in-flight replace, which flaps aborts as "concurrent update in progress", and it repeatedly re-read machines mid-transition.

  • Before re-issuing updates on a retry, wait for any machine that is currently replacing to reach a stable state (best-effort, bounded by waitTimeout).
  • Replace the fixed 1s retry sleep with capped exponential backoff, giving a churning app time to steady rather than piling on colliding updates.

Leases already carry across retries (appState copies the nonce from the prior state onto the re-fetched machines), so no lease-acquisition change is needed; the collisions were temporal, not lease-ownership, and the settle-wait targets that directly.

Adds TestRetryBackoff and TestWaitForReplacingMachinesToSettle.

Change Summary

What and Why:

How:

Related to:


Documentation

  • Fresh Produce
  • In superfly/docs, or asked for help from docs team
  • n/a

…retries

The recovery retry loop re-issued updates over every still-differing machine
with no wait for the prior operation to settle and a fixed 1s backoff. Against
a fast-restarting / mid-replace app this stacked a fresh update on top of an
in-flight replace, which flaps aborts as "concurrent update in progress" — the
abort storm seen in the incident — and it repeatedly re-read machines
mid-transition.

- Before re-issuing updates on a retry, wait for any machine that is currently
  `replacing` to reach a stable state (best-effort, bounded by waitTimeout).
- Replace the fixed 1s retry sleep with capped exponential backoff, giving a
  churning app time to steady rather than piling on colliding updates.

Leases already carry across retries (appState copies the nonce from the prior
state onto the re-fetched machines), so no lease-acquisition change is needed;
the collisions were temporal, not lease-ownership, and the settle-wait targets
that directly.

Adds TestRetryBackoff and TestWaitForReplacingMachinesToSettle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant