You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a03fd9a
Browse filesBrowse the repository at this point in the historyBrowse files
The pattern that broke the events broadcaster - guard a send with
utils.IsClosed(ch), then send blocking - was copied across four GraphQL
subscription signal channels: SummaryChannel, DashboardK8sResourcesChan,
K8scontextChan and the (unused) ConfigurationChannel. utils.IsClosed does
a non-blocking receive, so on these buffered cap-1 channels it destructively
consumed the pending refetch signal and then skipped the send, silently
dropping the update; the blocking send could also stall the publisher.
Convert every Publish to a non-blocking coalescing send taken from a
snapshot under the mutex, and fix the lifecycle where it made the send
unsafe:
- SummaryChannel's resolver closed its channel on ctx.Done but the helper
never removed it, so closed channels accumulated in the slice and a plain
non-blocking send would panic on them. Add Unsubscribe and have the
resolver detach instead of close.
- DashboardK8sResourcesChan never removed subscribers (unbounded growth).
Add Unsubscribe and defer it in the resolver.
- SummaryChannel/ConfigurationChannel were seeded with 10 nil channels via
make([]chan, 10); start empty.
utils.IsClosed has no callers left, so remove it: checking whether a
channel is closed via a receive is inherently destructive and racy and
should not exist.
Signed-off-by: Lee Calcote <[email protected]>
0 commit comments