Fix #73: notify SSE goroutine lifecycle #82
No reviewers
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!82
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-73"
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?
Fixes #73 (codex major): the per-user notify SSE keepalive goroutine leaked one per disconnected stream — stream.go ranged over s.ka.C while close() only called Ticker.Stop(), which never closes the channel.
Change (sender-closes discipline, 13 channel rule):
Regression tests (poll NumGoroutine to baseline, 5s deadline, no fixed sleeps): TestSSEWriterKeepaliveExitsOnClose / ...OnContextCancel (notify) and TestSSEKeepaliveExitsOnClose / ...OnContextCancel (api). Verified both close-path tests FAIL on pre-fix code (5 leaked goroutines, stacks naming the range) and pass after.
Results: gofmt clean, go vet clean, go test -race green for internal/notify (coverage 97.2%, gate >=95%) and internal/api.