CI waits out a service's restart instead of failing on its 503 (PIPT-75) #318

Merged
merge-queue merged 6 commits from forgejo-restart-wait into main 2026-11-30 21:55:23 -08:00
Owner

Forgejo is one pod that is stopped before its replacement starts, so during a rollout CI calls get 503s for several seconds and the job failed (PIPT-75). On 2026-11-30 the old pod got SIGTERM at 01:27:15, the new one listened at 01:27:23, and the Gateway logged 26 503s: first its own (the pod refusing the connection), then Forgejo's while it started. nelsong6/forgejo run 552's scope job failed on one, GET /topics: HTTP 503.

Added: actions/waiting-fetch.js, one fetch for all of CI. On a 502, 503 or 504, or no answer at all, it tries again every 2 s (5 s after the first minute), for up to 10 minutes, the room Forgejo's startup probe gives a new version's migrations. The log names what it saw:

  • the Gateway's own 503 (upstream connect error ... or no healthy upstream): nothing behind it is answering;
  • another 502/503/504: the service answered but can't serve yet;
  • no answer: the Gateway itself isn't reachable.

None of those says on its own whether the service is restarting or down; how long it lasts does. Back within 10 minutes, a ::notice:: says it was restarting and for how long; past 10 minutes the call fails saying it is down, not restarting.

Changed: every call CI makes to Forgejo, Artifact Keeper and auth (request() in suites/lib.mjs, 25 direct fetch calls, and the release-version and prune-releases actions) goes through it, with a timeout per attempt in place of one fixed signal.

Left alone: a timeout is not repeated, nor a request whose body is a stream. git (actions/checkout retries on its own), docker pushes, the runner's own fetch of actions, and services.mjs's local container poll are untouched.

🤖 Generated with Claude Code

Forgejo is one pod that is stopped before its replacement starts, so during a rollout CI calls get 503s for several seconds and the job failed ([PIPT-75](https://openproject.home.romaine.life/wp/PIPT-75)). On 2026-11-30 the old pod got SIGTERM at 01:27:15, the new one listened at 01:27:23, and the Gateway logged 26 503s: first its own (the pod refusing the connection), then Forgejo's while it started. nelsong6/forgejo run 552's scope job failed on one, `GET /topics: HTTP 503`. **Added:** `actions/waiting-fetch.js`, one fetch for all of CI. On a 502, 503 or 504, or no answer at all, it tries again every 2 s (5 s after the first minute), for up to 10 minutes, the room Forgejo's startup probe gives a new version's migrations. The log names what it saw: - the Gateway's own 503 (`upstream connect error ...` or `no healthy upstream`): nothing behind it is answering; - another 502/503/504: the service answered but can't serve yet; - no answer: the Gateway itself isn't reachable. None of those says on its own whether the service is restarting or down; how long it lasts does. Back within 10 minutes, a `::notice::` says it was restarting and for how long; past 10 minutes the call fails saying it is down, not restarting. **Changed:** every call CI makes to Forgejo, Artifact Keeper and auth (`request()` in `suites/lib.mjs`, 25 direct `fetch` calls, and the release-version and prune-releases actions) goes through it, with a `timeout` per attempt in place of one fixed `signal`. **Left alone:** a timeout is not repeated, nor a request whose body is a stream. git (actions/checkout retries on its own), docker pushes, the runner's own fetch of actions, and services.mjs's local container poll are untouched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CI waits out a service's restart instead of failing on its 503 (PIPT-75)
Some checks failed
Tofu providers / lock (pull_request) Successful in 2s
CI / changes (pull_request) Successful in 3s
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
Fleet / align (pull_request) Failing after 4s
CI / cache-save (windows-latest) (pull_request) Has been skipped
CI / check-versions (pull_request) Has been skipped
CI / check-fetches (pull_request) Has been skipped
CI / check-image-digests (pull_request) Has been skipped
merge-queue CI failed: Fleet / align (pull_request)
CI / cached-images (pull_request) Has been skipped
CI / container-health (pull_request) Has been skipped
CI / azure-cli (pull_request) Has been skipped
CI / home-cache-linux (pull_request) Has been skipped
CI / home-cache-windows (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 5s
Suite default / check-fetches (pull_request) Has been skipped
CI / prune-releases (pull_request) Successful in 5s
CI / release-version (pull_request) Successful in 5s
CI / manifest-check-linux (pull_request) Successful in 6s
CI / actionlint (pull_request) Successful in 7s
Suite default / check-rules (pull_request) Successful in 12s
Suite default / check-logs (pull_request) Successful in 11s
CI / service-cancellation (pull_request) Failing after 16s
CI / service-runtime (two) (pull_request) Successful in 22s
CI / service-runtime (one) (pull_request) Successful in 22s
CI / suite-tests-linux (pull_request) Successful in 35s
Suite default / reused-checks (pull_request) Successful in 11s
CI / setup-linux (cluster) (pull_request) Successful in 1m19s
CI / setup-windows (pull_request) Has been cancelled
CI / suite-tests-windows (pull_request) Has been cancelled
4eba615009
First-time contributor

merge-queue stopped this at 4eba615: CI failed: Fleet / align (pull_request). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at 4eba615: CI failed: Fleet / align (pull_request). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
The wait names the Gateway's connection-refused 503 as nothing answering, and says restart or down by how long it lasts
Some checks failed
Tofu providers / lock (pull_request) Successful in 2s
Fleet / align (pull_request) Failing after 4s
CI / cache-save (windows-latest) (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 5s
CI / check-image-digests (pull_request) Has been skipped
CI / container-health (pull_request) Has been skipped
CI / azure-cli (pull_request) Has been skipped
merge-queue CI failed: Fleet / align (pull_request)
CI / cached-images (pull_request) Has been skipped
CI / home-cache-linux (pull_request) Has been skipped
CI / check-versions (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Has been skipped
CI / manifest-check-linux (pull_request) Successful in 6s
CI / actionlint (pull_request) Successful in 6s
CI / service-runtime (one) (pull_request) Successful in 17s
CI / service-runtime (two) (pull_request) Successful in 17s
Suite default / reused-checks (pull_request) Successful in 7s
CI / suite-tests-linux (pull_request) Successful in 22s
CI / check-fetches (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
CI / prune-releases (pull_request) Successful in 3s
Suite default / check-logs (pull_request) Successful in 11s
CI / changes (pull_request) Successful in 3s
CI / home-cache-windows (pull_request) Has been skipped
CI / release-version (pull_request) Successful in 6s
Suite default / check-rules (pull_request) Successful in 11s
CI / setup-linux (cluster) (pull_request) Successful in 1m0s
CI / suite-tests-windows (pull_request) Failing after 18s
CI / service-cancellation (pull_request) Failing after 14s
CI / setup-windows (pull_request) Failing after 27s
f0b605b285
First-time contributor

merge-queue stopped this at f0b605b: CI failed: Fleet / align (pull_request). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at f0b605b: CI failed: Fleet / align (pull_request). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
The cancellation test's fixture carries lib.mjs's waiting fetch
Some checks failed
Tofu providers / lock (pull_request) Successful in 4s
Fleet / align (pull_request) Failing after 6s
CI / azure-cli (pull_request) Has been skipped
CI / service-runtime (one) (pull_request) Successful in 25s
CI / service-cancellation (pull_request) Successful in 27s
Suite default / reused-checks (pull_request) Successful in 7s
CI / setup-linux (cluster) (pull_request) Successful in 1m13s
CI / check-image-digests (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 11s
CI / changes (pull_request) Successful in 5s
CI / check-fetches (pull_request) Has been skipped
CI / check-versions (pull_request) Has been skipped
CI / actionlint (pull_request) Successful in 10s
CI / release-version (pull_request) Successful in 7s
Suite default / check-logs (pull_request) Successful in 14s
CI / cached-images (pull_request) Has been skipped
merge-queue CI failed: Fleet / align (pull_request)
CI / container-health (pull_request) Has been skipped
CI / home-cache-windows (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
CI / cache-save (windows-latest) (pull_request) Has been skipped
CI / prune-releases (pull_request) Successful in 5s
CI / manifest-check-linux (pull_request) Successful in 11s
CI / service-runtime (two) (pull_request) Successful in 23s
CI / home-cache-linux (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 15s
CI / setup-windows (pull_request) Failing after 49s
CI / suite-tests-linux (pull_request) Successful in 29s
CI / suite-tests-windows (pull_request) Failing after 1m11s
a4f9ca6c1f
First-time contributor

merge-queue stopped this at a4f9ca6: CI failed: Fleet / align (pull_request). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at a4f9ca6: CI failed: Fleet / align (pull_request). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
Merge remote-tracking branch 'origin/main' into forgejo-restart-wait
Some checks failed
merge-queue 2nd in line, behind #333: Overlapping runs of one Rust job build in separate copies of its folder
Suite default / scope (pull_request) Successful in 37s
CI / check-fetches (pull_request) Has been skipped
CI / home-cache-windows (pull_request) Has been skipped
CI / suite-tests-windows (pull_request) Successful in 1m56s
CI / azure-cli (pull_request) Has been skipped
CI / home-cache-linux (pull_request) Has been skipped
CI / cache-save (windows-latest) (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
Tofu providers / lock (pull_request) Successful in 14s
CI / changes (pull_request) Successful in 17s
CI / check-versions (pull_request) Has been skipped
CI / cached-images (pull_request) Has been skipped
CI / container-health (pull_request) Has been skipped
CI / check-image-digests (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Has been skipped
Fleet / align (pull_request) Successful in 46s
CI / setup-windows (pull_request) Successful in 3m49s
CI / actionlint (pull_request) Has been cancelled
CI / prune-releases (pull_request) Has been cancelled
CI / release-version (pull_request) Has been cancelled
CI / setup-linux (cluster) (pull_request) Has been cancelled
CI / service-runtime (one) (pull_request) Has been cancelled
CI / service-runtime (two) (pull_request) Has been cancelled
CI / service-cancellation (pull_request) Has been cancelled
CI / manifest-check-linux (pull_request) Has been cancelled
CI / suite-tests-linux (pull_request) Has been cancelled
Suite default / check-rules (pull_request) Has been cancelled
Suite default / check-logs (pull_request) Has been cancelled
Suite default / reused-checks (pull_request) Has been cancelled
48645ee777
Merge branch 'main' into forgejo-restart-wait
Some checks failed
Suite default / check-rules (pull_request) Successful in 30s
Suite default / check-logs (pull_request) Successful in 32s
Fleet / align (pull_request) Successful in 30s
Suite default / scope (pull_request) Successful in 16s
Suite default / check-fetches (pull_request) Has been skipped
Tofu providers / lock (pull_request) Successful in 7s
CI / cache-save (windows-latest) (pull_request) Has been skipped
Suite default / reused-checks (pull_request) Successful in 20s
CI / release-version (pull_request) Successful in 6s
CI / changes (pull_request) Successful in 4s
CI / check-image-digests (pull_request) Has been skipped
CI / cached-images (pull_request) Has been skipped
CI / container-health (pull_request) Has been skipped
CI / home-cache-windows (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
CI / home-cache-linux (pull_request) Has been skipped
CI / azure-cli (pull_request) Has been skipped
CI / check-versions (pull_request) Has been skipped
CI / check-fetches (pull_request) Has been skipped
CI / prune-releases (pull_request) Successful in 7s
CI / actionlint (pull_request) Successful in 10s
CI / manifest-check-linux (pull_request) Successful in 10s
CI / setup-linux (cluster) (pull_request) Successful in 4m33s
CI / service-cancellation (pull_request) Successful in 1m3s
CI / setup-windows (pull_request) Successful in 4m8s
CI / suite-tests-windows (pull_request) Successful in 1m52s
CI / suite-tests-linux (pull_request) Successful in 1m56s
merge-queue 2nd in line, behind #324: The shared CI builds, tests and signs Android apps; the phone apps release through it (PIPT-81)
CI / service-runtime (one) (pull_request) Has been cancelled
CI / service-runtime (two) (pull_request) Has been cancelled
ccd388b2a0
First-time contributor

merge-queue stopped this at ccd388b: CI failed: CI / service-cancellation (pull_request), CI / service-runtime (one) (pull_request), CI / service-runtime (two) (pull_request), CI / setup-linux (cluster) (pull_request), CI / suite-tests-…. Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at ccd388b: CI failed: CI / service-cancellation (pull_request), CI / service-runtime (one) (pull_request), CI / service-runtime (two) (pull_request), CI / setup-linux (cluster) (pull_request), CI / suite-tests-…. Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
First-time contributor

merge-queue stopped this at ccd388b: CI failed: CI / service-runtime (two) (pull_request). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at ccd388b: CI failed: CI / service-runtime (two) (pull_request). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
Merge branch 'main' into forgejo-restart-wait
All checks were successful
CI / setup-linux (cluster) (pull_request) Successful in 1m25s
Suite default / check-fetches (pull_request) Has been skipped
CI / prune-releases (pull_request) Successful in 5s
CI / changes (pull_request) Successful in 5s
CI / check-fetches (pull_request) Has been skipped
CI / home-cache-linux (pull_request) Has been skipped
CI / container-health (pull_request) Has been skipped
Tofu providers / lock (pull_request) Successful in 3s
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
CI / cache-save (windows-latest) (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 8s
CI / check-image-digests (pull_request) Has been skipped
CI / release-version (pull_request) Successful in 7s
Suite default / check-rules (pull_request) Successful in 19s
CI / service-runtime (two) (pull_request) Successful in 33s
CI / suite-tests-linux (pull_request) Successful in 47s
CI / actionlint (pull_request) Successful in 9s
Suite default / check-logs (pull_request) Successful in 18s
CI / service-runtime (one) (pull_request) Successful in 34s
CI / service-cancellation (pull_request) Successful in 41s
Suite default / reused-checks (pull_request) Successful in 16s
CI / setup-windows (pull_request) Successful in 2m11s
merge-queue landed on main
CI / check-versions (pull_request) Has been skipped
CI / cached-images (pull_request) Has been skipped
CI / azure-cli (pull_request) Has been skipped
Fleet / align (pull_request) Successful in 13s
CI / manifest-check-linux (pull_request) Successful in 8s
CI / suite-tests-windows (pull_request) Successful in 1m21s
CI / home-cache-windows (pull_request) Has been skipped
dda94f6106
merge-queue deleted branch forgejo-restart-wait 2026-11-30 21:55:23 -08:00
Sign in to join this conversation.
No description provided.