fix: smoother rollouts for checkers, and say when they recover #158

Merged
Sebi merged 2 commits from fix/checker-recovery-and-rollouts into main 2026-11-25 23:02:17 +00:00
Owner

Why

During the rollout of 0.6.0 the checkers logged timeouts, 504 Gateway Timeout and GOAWAY. They then recovered on their own, but logged nothing about it, so the log read as stuck.

1. Recovery is logged

  • Once per outage: after failures the checker logs polling for jobs works again (failed_for, failures) and reporting results works again (failed_for, sent: the delivered backlog), once each.
  • No tight loop: a long poll answered empty at once is not repeated at once.

2. Rollouts without cut-off polls

  • API: checkers long-poll /agent/v1/jobs for up to 25 s, longer than the shutdown waits (20 s), so their connections were cut. A draining API (Health.Draining()) now ends long polls within about 1 s, empty. It still holds them that second, so older checkers that re-poll at once do not spin. The next poll reaches another instance.
  • Chart: the API and status page servers roll with maxUnavailable: 0, maxSurge: 1 and minReadySeconds: 5, so the ingress has the new pod before an old one goes.

Tests

  • TestRecoveryIsLogged: flaky fake API, both recoveries logged once.
  • TestLongPollsEndWhenDraining: a 20 s poll ends about 1 s after drain begins; later polls end at once.
  • helm lint and helm template are clean, as are go test -p 1 ./..., go vet and gofmt.

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

## Why During the rollout of 0.6.0 the checkers logged timeouts, `504 Gateway Timeout` and `GOAWAY`. They then recovered on their own, but logged nothing about it, so the log read as stuck. ## 1. Recovery is logged - **Once per outage:** after failures the checker logs `polling for jobs works again` (`failed_for`, `failures`) and `reporting results works again` (`failed_for`, `sent`: the delivered backlog), once each. - **No tight loop:** a long poll answered empty at once is not repeated at once. ## 2. Rollouts without cut-off polls - **API:** checkers long-poll `/agent/v1/jobs` for up to 25 s, longer than the shutdown waits (20 s), so their connections were cut. A draining API (`Health.Draining()`) now ends long polls within about 1 s, empty. It still holds them that second, so older checkers that re-poll at once do not spin. The next poll reaches another instance. - **Chart:** the API and status page servers roll with `maxUnavailable: 0`, `maxSurge: 1` and `minReadySeconds: 5`, so the ingress has the new pod before an old one goes. ## Tests - `TestRecoveryIsLogged`: flaky fake API, both recoveries logged once. - `TestLongPollsEndWhenDraining`: a 20 s poll ends about 1 s after drain begins; later polls end at once. - `helm lint` and `helm template` are clean, as are `go test -p 1 ./...`, `go vet` and `gofmt`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 2 commits 2026-11-25 23:00:26 +00:00
A checker logged only failures, so after an outage of the API, as during a
rollout, its log ended on an error and read as stuck although it had
recovered. Polling and reporting now log once when they work again, with
how long they failed and how many results the backlog delivered. A long
poll answered empty at once is not repeated at once either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
fix: roll the API out without cutting off checkers
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / test (pull_request) Canceled after 4m25s
ci / lint (pull_request) Canceled after 4m26s
ci / build (pull_request) Canceled after 0s
ci / image (pull_request) Canceled after 0s
963c677e1c
Checkers long-poll the API for up to 25 seconds, longer than a shutdown
waits for requests, so a rollout cut their polls off (GOAWAY, timeouts).
A draining API now ends long polls within about a second, empty, and the
checker's next poll reaches another instance.

The chart rolls the API and status page servers one pod at a time with
maxUnavailable 0, and a new pod serves for 5 seconds before an old one
goes, so the ingress has picked it up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 87918eff80 into main 2026-11-25 23:02:17 +00:00
Sebi deleted branch fix/checker-recovery-and-rollouts 2026-11-25 23:02:19 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#158