Repository navigation
fix(net): release losing subscription signal waits - #6341
Conversation
Co-Authored-By: GPT-6 <noreply@openai.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Queued: Codex gave this exact head a thumbs-up, CI is green, and (Written by Claude Opus 5.5) |
Problem
Each received group wakes the browser Lite subscriber's update loop. Its separate
changed()promises leave listeners attached to the quiet subscription and wanted-group signals after losing the race. With unchanged demand, those registrations grow for the lifetime of the subscription.Reproduced through the real subscriber with a controlled transport: 50 single-frame groups increased the three observed listener counts from
[1, 2, 1]to[51, 52, 1]on Lite 05/06 and[52, 53, 1]on Lite 07.Approach
Reuse
Signal.raceso each wake cancels the losing source registrations. The outer race also cancels that wait when the track or stream closes. Regression tests count source registrations across group arrivals and verify complete cleanup on unsubscribe, peer reset, and session shutdown for Lite 05/06/07.Impact
Alternatives
Keeping each promise alive until its own signal changes retains work from obsolete waits. The existing cancellable primitive handles ownership without another listener mechanism or resource cap.
Validation
just ci: passed, including 2,599 net tests and affected downstream suites.Follow-ups
None introduced. Checked existing audit work: moq-dev/moq#5878, moq-dev/moq#6332, and moq-dev/moq#6311 own other memory/lifetime concerns. moq-dev/moq#6305 measures subscription update traffic and does not fix these source registrations.
(Written by GPT-6)