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
[P1] Close upstream streams when viewers disconnect and health probes finish #171
The stream route's response-close cleanup unregisters usage but never destroys or aborts the upstream request/body. A viewer disconnect can leave a paused live stream holding a tuner/provider connection. checkStream() in scripts/check-channel-health.js removes data listeners after its byte/time budget but likewise never destroys the GET body. Repeated scheduled probes can retain connections. The image proxy has similar missing cancellation/error cleanup.
Evidence: Static lifecycle review of server/lineup.js, scripts/check-channel-health.js:checkStream, and libs/proxy-image.js. Existing playback tests mainly inspect response payloads rather than upstream close events.
Acceptance criteria:
Propagate downstream cancellation to both pending fetches and established upstream bodies.
Destroy health-probe bodies in finally after success, timeout, and error; ensure error bodies are also released.
Make cleanup idempotent and preserve accurate usage tracking.
Add streaming-server tests that assert upstream sockets close after client abort/probe completion and that repeated probes do not grow active connections.
Validation note: the local full test suite could not pass because the installed better-sqlite3 binary is incompatible with the available ARM64 Node runtime. Reproductions mentioned above use isolated dependencies and do not claim full application integration coverage.
Activity
cbulock commentedon Sep 6, 2026
Fixed in merged PR #183.