Skip to content

Settle wait only after sustained, restart-free checks - #130

Merged
firecow merged 1 commit into
mainfrom
fix/wait-stability-window
Jul 31, 2026
Merged

Settle wait only after sustained, restart-free checks#130
firecow merged 1 commit into
mainfrom
fix/wait-stability-window

Conversation

@firecow

@firecow firecow commented Jun 22, 2026

Copy link
Copy Markdown
Member

The wait command declared success on the first poll where every service had its desired replicas running and no active UpdateStatus. Swarm marks a task running the moment it starts, so a crash-looping container is running between restarts; a single lucky poll yielded a false green (wheatley-server 2.4.0 crash-looping in prod while the deploy job went green on retry).

A service is now settled only when, for stableChecks (default 3) consecutive checks: replicas are fully running, no active update, and no newly failed task has appeared. A new task failure puts the service on a restarting cooldown for a full stableChecks window, so a container that crash-loops faster than that window can never reach success.

Verified on a local single-node swarm (alpine sleep 2; exit 1, restart loop ~6s period):

  • crash-loop at default interval 5s → correctly times out (3/3 fresh deploys)
  • old code on the same service → false Reconciliation succeeded
  • healthy service → succeeds
  • crash-loop updated to a healthy command → succeeds despite prior failure history

Limitation: detection needs the observation window (stableChecks-1) × interval (10s at defaults) to exceed the crash-restart period. wheatley restarts ~7s, so defaults catch it; a slower crash-loop (period >10s) would need a higher stableChecks or interval. Jest is unrelated/pre-broken on main (ESM config); tsc and eslint pass.

🤖 Generated with Claude Code

@firecow firecow self-assigned this Jun 22, 2026
Settle only after stableChecks consecutive checks with full replicas, no
active update, and no newly failed tasks. A new task failure keeps the
service unsettled for a full stableChecks window, so a container that
crash-loops faster than that window can never report success.
@firecow
firecow force-pushed the fix/wait-stability-window branch from 2967de2 to d14451d Compare June 22, 2026 12:58
@firecow firecow changed the title Require consecutive settled checks in wait Settle wait only after sustained, restart-free checks Jun 22, 2026
@firecow

firecow commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

claude --resume a603d5df-1c35-4772-a907-7d3ce96ff079

@firecow
firecow merged commit 14a3094 into main Jul 31, 2026
4 checks passed
@firecow
firecow deleted the fix/wait-stability-window branch July 31, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant