forge: bump forgejo-nsc to 82e3da07 (stop-monitor startup window fix + daemon TTL drain) #56

Merged
founder merged 1 commit from forge/forgejo-nsc-stop-monitor into main 2026-08-16 11:22:39 +00:00
Owner

Pulls in key-store/forgejo-nsc#1 (merged as 82e3da07).

Why: on the forge, 125 of 176 Namespace runner launches in the 24 h to 2026-08-16 10:00Z were destroyed 2–5 s after nsc run --wait returned. Reproduced as root: for the first ~3–6 s nsc describe --output json reports the resource with no container key, and instanceStopped() treated that as "all containers stopped". Also fixes the related hazard where daemon-mode runners accepted jobs right before their TTL (job 97045 / run 17183).

What changes on the forge after deploy (forgejo-nsc-dispatcher.service):

  • Stop monitor: 10 s initial delay, then nsc describe every 10 s; only a tombstone / stopped container (or "not found" after a container was seen or 2 m grace) ends the wait; transient describe errors retry. New Info logs: runner first stop check (raw JSON), runner instance phase changed, runner instance reported gone.
  • Daemon runners drain before TTL: FORGEJO_RUNNER_TTL_DEADLINE_EPOCH + FORGEJO_RUNNER_DRAIN_SECONDS (TTL/3 clamped 5m..30m → 30 m for the 90 m amd64/arm64-large targets, 5 m for 15 m small) → SIGTERM forgejo-runner daemon at deadline−drain with shutdown_timeout = drain−60 s. Override per target via env.FORGEJO_RUNNER_DRAIN_SECONDS.

go.mod/go.sum unchanged upstream → same vendorHash; verified locally with nix build .#forgejo-nsc-dispatcher.

Rollout: deploy the forge, then re-run the journalctl census (launched → destroyed within 15 s should drop to ~0 while jobs still get runners).

Pulls in [key-store/forgejo-nsc#1](https://git.key.store/key-store/forgejo-nsc/pulls/1) (merged as `82e3da07`). **Why:** on the forge, 125 of 176 Namespace runner launches in the 24 h to 2026-08-16 10:00Z were destroyed 2–5 s after `nsc run --wait` returned. Reproduced as root: for the first ~3–6 s `nsc describe --output json` reports the resource with **no `container` key**, and `instanceStopped()` treated that as "all containers stopped". Also fixes the related hazard where daemon-mode runners accepted jobs right before their TTL (job 97045 / run 17183). **What changes on the forge after deploy** (`forgejo-nsc-dispatcher.service`): - Stop monitor: 10 s initial delay, then `nsc describe` every 10 s; only a tombstone / stopped container (or "not found" after a container was seen or 2 m grace) ends the wait; transient describe errors retry. New Info logs: `runner first stop check` (raw JSON), `runner instance phase changed`, `runner instance reported gone`. - Daemon runners drain before TTL: `FORGEJO_RUNNER_TTL_DEADLINE_EPOCH` + `FORGEJO_RUNNER_DRAIN_SECONDS` (TTL/3 clamped 5m..30m → 30 m for the 90 m amd64/arm64-large targets, 5 m for 15 m small) → SIGTERM `forgejo-runner daemon` at deadline−drain with `shutdown_timeout = drain−60 s`. Override per target via `env.FORGEJO_RUNNER_DRAIN_SECONDS`. `go.mod`/`go.sum` unchanged upstream → same `vendorHash`; verified locally with `nix build .#forgejo-nsc-dispatcher`. **Rollout:** deploy the forge, then re-run the journalctl census (launched → destroyed within 15 s should drop to ~0 while jobs still get runners).
forge: bump forgejo-nsc to 82e3da07 (stop-monitor startup window fix + daemon TTL drain)
Some checks failed
Build: SQLite SEE / Redacted SEE compile (pull_request) Successful in 7s
Build: Apple / Check (SwiftLint) (pull_request) Successful in 18s
Build: KaiOS / Build (KaiOS) (pull_request) Successful in 21s
Build: Apple / Build (visionOS) (pull_request) Successful in 25s
Build: Apple / Build (iOS) (pull_request) Successful in 29s
Build: Linux / Build (keystore-forge x86_64) (pull_request) Has been cancelled
Build: Apple / Build (macOS) (pull_request) Has been cancelled
Build: Linux / Build (Linux x86_64) (pull_request) Has been cancelled
Build: Web / Build (Web) (pull_request) Has been cancelled
93766a2f58
Pulls in key-store/forgejo-nsc#1: the dispatcher's stop monitor no longer
treats a fresh instance's missing container list as "stopped" (that was
destroying ~70% of Namespace launches 2-5 s after `nsc run --wait`
returned), and daemon-mode runners now stop accepting jobs ahead of their
`nsc run --duration` TTL (FORGEJO_RUNNER_TTL_DEADLINE_EPOCH /
FORGEJO_RUNNER_DRAIN_SECONDS, shutdown_timeout in runner.yaml).

go.mod/go.sum are unchanged upstream, so vendorHash stays; verified with
`nix build .#forgejo-nsc-dispatcher`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
founder force-pushed forge/forgejo-nsc-stop-monitor from 93766a2f58
Some checks failed
Build: SQLite SEE / Redacted SEE compile (pull_request) Successful in 7s
Build: Apple / Check (SwiftLint) (pull_request) Successful in 18s
Build: KaiOS / Build (KaiOS) (pull_request) Successful in 21s
Build: Apple / Build (visionOS) (pull_request) Successful in 25s
Build: Apple / Build (iOS) (pull_request) Successful in 29s
Build: Linux / Build (keystore-forge x86_64) (pull_request) Has been cancelled
Build: Apple / Build (macOS) (pull_request) Has been cancelled
Build: Linux / Build (Linux x86_64) (pull_request) Has been cancelled
Build: Web / Build (Web) (pull_request) Has been cancelled
to 9abe479091
Some checks failed
Build: SQLite SEE / Redacted SEE compile (pull_request) Successful in 6s
Namespace: Build Images / Refresh macOS runner lane (push) Successful in 7s
Namespace: Build Images / Refresh Linux runner image (push) Successful in 8s
Build: Apple / Check (SwiftLint) (pull_request) Successful in 16s
Build: Apple / Check (SwiftLint) (push) Successful in 16s
Build: KaiOS / Build (KaiOS) (pull_request) Successful in 21s
Build: KaiOS / Build (KaiOS) (push) Failing after 16s
Build: Apple / Build (visionOS) (pull_request) Successful in 28s
Build: Apple / Build (iOS) (pull_request) Successful in 29s
Build: SQLite SEE / Redacted SEE compile (push) Successful in 43s
Build: Apple / Build (iOS) (push) Successful in 28s
Build: Apple / Build (visionOS) (push) Successful in 23s
Release: Signing Preflight / Release (Signing Preflight) (push) Successful in 1m26s
Deploy: Web / Deploy (Web) (push) Successful in 2m18s
Build: Apple / Build (macOS) (pull_request) Successful in 2m8s
Build: Apple / Build (macOS) (push) Successful in 1m51s
Deploy: API / Deploy (API) (push) Successful in 3m2s
Release: If Needed / Check (Release Needed) (push) Successful in 5m10s
Build: Web / Build (Web) (push) Has been cancelled
Build: Linux / Build (Linux x86_64) (push) Successful in 24m14s
Build: Linux / Build (keystore-forge x86_64) (push) Has been skipped
Build: Linux / Build (Linux x86_64) (pull_request) Successful in 29m41s
Build: Linux / Build (keystore-forge x86_64) (pull_request) Has been skipped
Build: Web / Build (Web) (pull_request) Failing after 18m53s
2026-08-16 11:22:36 +00:00
Compare
founder deleted branch forge/forgejo-nsc-stop-monitor 2026-08-16 11:22:39 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
key-store/key.store!56
No description provided.