fix(proxy): raise inactive-session timeout 60s → 5m#692
Merged
Conversation
removeInactiveSessions synthesizes a terminal inactive_timeout for any session whose last request is older than the window, then frees its port. At 60s this evicted plays that were merely *rebuffering*: a characterization cycled-sweep that slams the cap from a 4K rung back to the ~2 Mbps floor between cycles strands AVPlayer mid-4K-segment and it stalls ~50s+ draining/refilling — well under any real abandonment, but over 60s, so the play was killed and later cycles ran empty. 5m comfortably covers a legitimate downshift-rebuffer while still reaping genuinely-gone devices. Pulled into a named const so the intent and value live in one place. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
removeInactiveSessionssynthesizes a terminalinactive_timeoutfor any session whose last request is older than the window, then frees its port. At 60s this evicted plays that were merely rebuffering.Why
A characterization cycled sweep slams the cap from a 4K rung (~44 Mbps) straight back to the ~2 Mbps floor between cycles. AVPlayer, stranded mid-4K-segment, stalls ~50s+ draining and refilling the buffer — well under any real abandonment, but over the 60s window. The proxy killed the play, returned the app to Home, and every cycle after the first ran empty (observed in a 3-cycle 2s rampup: cyc1 climbed cleanly to 4K, then the cyc1→cyc2 floor slam stalled ~53s →
playback_reason: inactive_timeout).Change
Window 60s → 5m, pulled into a named
const inactiveWindowso the value and rationale live together. 5m comfortably covers a legitimate downshift-rebuffer while still reaping genuinely-gone devices.🤖 Generated with Claude Code