[omp major] Task goroutines ignore ctx cancel #154
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#154
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[omp major] Task goroutines ignore ctx cancel
internal/notify/tasks.go:285-289,:330:StartWebhooksusesWithoutCancel,drainFanoutusesBackground(); neither runs in a tracked WaitGroup — a wedged store call hangs them forever, immune to drain/shutdown.Fix
Thread the phase-1/drain context through (same shape as the #74 import fix); track in a WaitGroup or make hangs impossible (deadlines on store work). Regression test (wedged store + drain → prompt exit). Coverage gate holds; doc Decisions entry (law 12).
Acceptance criteria
-race.Fixed by #160 (branch fix/issue-154): notify task leaders now run on the service drainCtx (cancelled by new Service.Drain, wired into serve.go phase 1 beside importSvc.Drain — same shape as the #74 import fix) and are tracked in Service.wg; new tasks refuse fast once draining. Regression tests (wedged store + drain → prompt exit) verified hanging pre-fix. Suite green -race, coverage 96.1%, gofmt/vet clean.
PR #160 review (branch fix/issue-154, commit
83f0de4+ review fixup1057838):All six checks pass. Verified in scratch worktree /tmp/pr160 (since removed): go test -race ./internal/notify/... ./cmd/... green, notify coverage 96.1% (>=95 gate holds), gofmt/vet clean, no new third-party imports (only first-party internal/store in the new test).
Small fix pushed by reviewer (
1057838): DeliverRepo's ctx.Done arm used bare return, orphaning in-flight hook workers past wg.Wait (arm was dead code pre-fix under WithoutCancel, live now). Changed to labeled break so the loop stops launching but still Waits; workers observe dead ctx and fail fast, wait stays bounded. Re-tested race+coverage after.MERGE RECOMMENDATION: ready to merge.
Fixed by PR #160 incl. review DeliverRepo break fix (#72 interaction verified safe; 96.1% coverage), merged. Closing.