Repository navigation
Description
Summary
The host controller (v0.1.24, melo-lap-001) wedged twice within 13 hours. Both times the process stayed alive and the control plane kept answering host status, but the reconcile loop stopped: observed.heartbeatAt froze, no worker was created or retired, and every job for melodic-ubuntu-24.04-x64 sat queued at GitHub while GitHub's own status page reported all systems operational.
Evidence
Wedge 1 (2026-09-04 01:03Z to 01:53Z, PID 14732, uptime about 24 h):
host status --json:controller.phase=ready,observed.heartbeatAt=2026-09-04T01:03:14Zfor 50 minutes; three workers reported (idle,busy,busy) whiledocker psshowed zeroci-runner-*containers. Worker log fordl64halo74o4-2v8ends at 01:03:30Z with a cleanRunner listener exit with 0 return code.- Process had consumed about 126,899 CPU-seconds over its lifetime (~1.4 cores continuously).
host controller restarthung 240 s waiting for the drain confirmations the dead loop never produced.taskkill /Fplusschtasks /Run /TN ci-runner-fleetrecovered it; first fresh heartbeat 01:57:36Z, queue drained within two minutes.
Wedge 2 (2026-09-04, PID 206652 from 01:53Z, then PID 89152 after a graceful restart at 13:54Z):
- From about 13:40Z GitHub stopped assigning queued jobs to the scale set although four workers were idle,
capacityAcknowledged=true,maxCapacity=11,totalAssignedJobs=0; 17 github-iac jobs queued for 12 minutes. Controller log in that window shows onlyworker-retirement-zero-stability-unconfirmed(x10),worker-removal-capacity-stale(x9), onerunner-registration-missing, oneunregistered-worker-became-busy. host controller restartcompleted cleanly this time (capacity-zero drain accepted, exit code 75, receipt verified, replacement PID 89152 started 13:54:51Z).- The replacement never left
phase=disabledalthoughdesired.mode=enabled:observed.heartbeatAtstayed at 13:54:49Z for 9+ minutes, both listeners atcapacity=0, zero workers, controller log contains only thecontroller-startedline. Process CPU: 11.05 s in a 10 s window (busy loop), 23 threads, 148 MB, and the only TCP connection was the local OTEL exporter on 127.0.0.1:4317 (no GitHub or Docker API traffic).host enable --waithung 180 s.host doctorreported every check PASS except the advisory pending-OS-reboot WARN.
Host: Windows 11 Pro 26200, Docker Desktop responsive throughout (docker version/docker info under 1 s), AC power, 37 GiB free memory, host CPU otherwise idle.
Fix
Unknown; needs the reconcile loop's own diagnostics. Suggested first steps:
- Make the loop's liveness observable: a stall of
observed.heartbeatAtbeyondreconcileIntervalx N should be surfaced byhost doctoras a FAIL, not PASS (it showed PASS withage=2m17s maximumAge=26m10swhile the loop was already dead). - Capture a goroutine dump (or the equivalent) on
host controller restarttimeout and on a heartbeat stall, written underdiagnostics/. - Check the startup path for a busy-wait: the replacement process spun at ~1 core with no network activity and no log lines after
controller-started.
Verification
- A controller that has stalled for longer than the documented threshold is reported by
host doctoras FAIL with the stall age. - A diagnostic archive exists for each stall and names the blocked goroutine or loop.
Related
- Wedge 1 recovery commands and timings are recorded in the operator's session notes for 2026-09-04.
- Config:
%LOCALAPPDATA%\ci-runner\config.yaml(schemaVersion 2,reconcileInterval: 5s,startupTimeout: 2m,power.policy: ac-only).
Activity
kyle-sexton commentedon Sep 4, 2026
Additional evidence from the 14:05Z relaunch (PID 58404):
controller-startedat 14:05:07Z, firstobserved.jsonheartbeat at 14:08:32Z (about 3.5 minutes), during whichhost status --jsonkept returning the previous process's frozen snapshot (phase=disabled,heartbeatAt=13:54:49Z) and the process burned about 0.7 core with no GitHub traffic.jobs.json8,387,632 bytes (recordsarray,schemaVersion1),runner-assign-times.json1,872,655 bytes, plus 3,225 log entries and 6,407 diagnostics entries. If the reconcile loop re-reads and re-serialisesjobs.jsonon every 5 s tick, that alone would explain both the sustained CPU burn and the multi-minute startup, and it grows without bound. Worth checking whetherjobs.jsonis ever compacted.kyle-sexton commentedon Sep 5, 2026
This was generated by AI during triage.
Triage lane claiming this item for the current cycle (instance
vm-triage-202609050304). Lease TTL 60 minutes, expires2026-09-05T04:09:00Z. Claim covers classification and brief-authoring only — this lane does not author fix PRs or merge.Generated by Claude Code
kyle-sexton commentedon Sep 5, 2026
This was generated by AI during triage.
Triage: confirmed real; one of the three defects here is fully root-caused, the wedge itself is not
Verified against
01594bd(default branch). This issue bundles three separable defects with different owners, different evidence needs, and very different readiness. Recommending a split, detail below.Defect A —
host doctorreports PASS while the reconcile loop is dead (ROOT-CAUSED)This is the "doctor showed PASS with
age=2m17s maximumAge=26m10swhile the loop was already dead" observation, and the cause is a single conflated threshold.internal/app/doctor.go:79sizes the heartbeat freshness limit withobservedFreshnessLimit, which is (doctor.go:322):That budget is
(requestTimeout + retryBackoff) × (maxAttempts × targets) + 2 × reconcileInterval— a worst-case GitHub round-trip budget, which is why it inflates to ~26 minutes. It is then used to answer a completely different question: is the reconcile loop alive? WithreconcileInterval: 5s, a totally dead loop reads "fresh" for 26 minutes.Those are two distinct thresholds and should not share a value. Loop liveness is a local property (
reconcileInterval × small N, seconds) and has nothing to do with how slow GitHub might be. The GitHub budget legitimately governs capacity-acknowledgement staleness, not heartbeat liveness.observedFreshnessLimit, since other call sites depend on the GitHub-derived budget. Add a separate liveness threshold.Defect B — the wedge itself (NOT root-caused; needs evidence that does not exist yet)
The reconcile loop stops while the process stays alive and the control plane keeps answering. Nothing in the source read so far explains this, and it is not reproducible from the repository: it is a Windows-host, timing-dependent hang observed twice on melo-lap-001. An agent cannot reproduce this. The blocking requirement is the issue's own suggested step 2 — a goroutine dump on heartbeat stall and on
host controller restarttimeout, written underdiagnostics/. Until that lands and catches one occurrence, any fix would be speculation.Recommend treating "capture a goroutine dump on stall/timeout" as its own small, delegable work item, and keeping the wedge diagnosis blocked on it. Note the ordering: Defect A's FAIL condition is the natural trigger for that dump, so A should land first.
Defect C — the slow/spinning startup (LIKELY A DUPLICATE OF #328)
The replacement process burning ~0.7-1 core with no GitHub or Docker traffic and taking 3.5 minutes to first heartbeat is very probably not a separate busy-wait bug. Per the follow-up comment here,
jobs.jsonwas 8,387,632 bytes andrunner-assign-times.json1,872,655 bytes.Triage of #328 confirmed in source that
FileStore.Upsert(internal/jobindex/file_store.go:158) commits unconditionally — no equality check — and that itsAfterReplacehook (file_store.go:336) rewrites the assign-times sidecar on every commit.Merge(catalog.go:74) stampsUpdatedAt = nowunconditionally, so no patch is ever a no-op. With oneUpsertper worker per tick, that is roughly 12 MiB/s of encode-fsync-rename churn with nothing assigned.The question raised in the follow-up comment — "worth checking whether
jobs.jsonis ever compacted" — has an answer:encodeWithinCapacity(file_store.go:361) compacts only under capacity pressure against the 8 MiBmaximumJobStatecap, by dropping tombstoned then completed records. It is a ceiling enforcer, not a retention policy. That is why the file has sat pinned at ~8 MiB for seven weeks rather than growing past it.Recommend closing C into #328 rather than tracking it twice. If #328's fix lands and startup is still multi-minute, reopen it as its own item with fresh evidence.
Recommended split
work-class: scopedI have not created sub-issues; decomposition of a live incident report is the reporter's call, and B's scope depends on what the dump should contain.
Classification of this issue as it stands
priority: critical. Every job formelodic-ubuntu-24.04-x64sat queued at GitHub across both windows and recovery requiredtaskkill /Fplus a manual scheduled-task run. Twice in 13 hours. This is a full CI stall for that runner label with no automatic recovery, and Defect A means it is currently invisible to monitoring.needs-human. Not delegable as a single unit — Defect B needs host-side evidence only the operator can capture, and the split above needs the reporter's sign-off. Defect A alone is agent-ready and could be lifted toagent-readythe moment it is split out.No fix PR opened; this lane classifies and briefs only.
Generated by Claude Code
kyle-sexton commentedon Sep 5, 2026
This was generated by AI during triage.
Triage lane releasing its claim (instance
vm-triage-202609050304). Item is triaged and briefed; labels applied:priority: critical,work-class: scoped,status: needs-decision,needs-human. Blocked on sign-off for the three-way split above, and Defect B additionally on host-side goroutine-dump evidence.Generated by Claude Code
fix(jobindex): skip durable save on no-op upsert (#381)
fix(doctor): fail on stalled reconcile-loop heartbeat (#382)
feat(controller): write goroutine dump on heartbeat stall and restart…
feat(controller): write goroutine dump on heartbeat stall and restart…
kyle-sexton commentedon Sep 23, 2026
Split and progress update:
host doctornow has acontroller-reconcile-livenesscheck that reports FAIL with the stall age once the heartbeat is older thanmax(5m, 6 × reconcileInterval).diagnostics/when its heartbeat stalls for 12 ×reconcileInterval. It also writes one whenhost controller restart's drain wait is abandoned; the CLI requests that dump over the control plane.Upsertno longer rewritesjobs.jsonand the assign-times sidecar on no-op patches. If startup is still multi-minute after this ships, reopen C as its own issue with fresh evidence.diagnostics/controller-goroutines-*.txt). Please attach it to this issue when it appears. This issue remains open for that.build(deps): drain 2026-09-23 freshness cycle for v0.1.25 (#386)
kyle-sexton commentedon Sep 23, 2026
Released in v0.1.26, with source
c156e6b. It contains #381, #382, and #383. (v0.1.25is a reserved tag: its release verification failed.) Once a host runs v0.1.26, the next stall makeshost doctorreport FAIL and writesdiagnostics/controller-goroutines-*.txt. Attach that file here.docs: record v0.1.25 as a reserved release tag (#387)
fix(controller): align the stall-dump threshold with doctor's livenes…
feat(status): expose controller per-tick cost in host status (#403)
fix(artifacts): retry failed retention sweeps at cleanupEvery
fix(artifacts): log retention sweep errors through the runtime error …
fix(controller): bound immediate Step reruns when admission inputs ji…