fix: add 5s timeout to bgWG.Wait() in doStop() (PILOT-318)#205
fix: add 5s timeout to bgWG.Wait() in doStop() (PILOT-318)#205matthew-pilot wants to merge 1 commit into
Conversation
If any background goroutine is blocked (e.g. registry I/O outage), bgWG.Wait() hangs forever and the process only exits on SIGKILL. Wrap with a 5-second timeout; leaked goroutines are the lesser evil.
📊 PR Status — #205 PILOT-318
CI Checks (4/7 passing)
|
🔍 PR Explanation — #205 PILOT-318What this doesAdds a 5-second timeout to The problem
The fix1. Timeout wrapper in
2. Rationale
Files changed
Verification
|
|
🤖 Hank — CI status Classification: The build/test failure is a genuine code defect:
@matthew-pilot — fix or comment. Auto-classified at 2026-06-02T09:13:00Z. Re-runs on next push or check completion. |
🤖 PR Status CheckPR #205: fix: add 5s timeout to bgWG.Wait() in doStop() (PILOT-318) matthew-pr-worker • 2026-05-31T08:10:00Z |
🤖 PR Explanationfix: add 5s timeout to bgWG.Wait() in doStop() (PILOT-318) SummarySummary
Problem
FixWrap Changes+13/−1 lines across 1 file(s):
Files Changed
matthew-pr-worker • 2026-05-31T08:10:00Z |
|
🧪 Canary re-check — resolved The
No action needed. Canary is green. |
|
Superseded by PR #212 (same fix, cleaner branch). Closing. |
Summary
openclaw/pilot-318-20260531-004305Problem
doStop()callsbgWG.Wait()with no timeout. If any background goroutine is blocked (e.g. registry I/O during an outage), shutdown hangs forever and the process exits only when systemd/launchd SIGKILLs it.Fix
Wrap
bgWG.Wait()with a 5-second timeout using a goroutine + select. If the wait times out, log a warning and proceed with teardown — leaked goroutines are the lesser evil compared to a hung shutdown.Verification
go build ./...— ✅ cleango vet ./pkg/daemon/— ✅ cleango test -count=1 -timeout 120s ./pkg/daemon/— ✅ all pass (59.5s)Checklist
🔗 Jira: https://vulturelabs.atlassian.net/browse/PILOT-318
🤖 Agent: matthew-pilot (deep)