Dispatcharr/apps/proxy
None 49b7b9e21b Fix: Connection capacity leak - failed stream initialization permanently consumes connection slot
Fixed four leak paths in the TS proxy streaming initialization:

1. url_utils.py - generate_stream_url(): Wrapped post-get_stream() code in try/except that calls release_stream() on any failure

2. views.py - stream_ts() retry loop: Added release_stream() before returning 503 to clean up the error-checking get_stream() call at line 181 which could INCR without a matching release when the retry loop times out

3. views.py - stream_ts() init failure: Added guarded release_stream() when initialize_channel() returns False, using a connection_allocated flag to prevent incorrect decrements when joining an existing channel

4. views.py - stream_ts() outer except: Added guarded release_stream() as a safety net for unexpected exceptions, only releasing when the flag confirms the slot was allocated and the channel hasn't been initialized yet

The connection_allocated flag prevents double-decrements by tracking whether request flow actually INCR'd the counter (fresh initialization) vs
returned cached results (joining an existing channel on another worker)
2026-02-05 23:12:30 -06:00
..
hls_proxy Fixes clients not disconnecting. 2025-03-04 11:08:12 -06:00
management/commands Initial integration. 2025-03-03 18:40:30 -06:00
ts_proxy Fix: Connection capacity leak - failed stream initialization permanently consumes connection slot 2026-02-05 23:12:30 -06:00
vod_proxy Change: VOD upstream read timeout reduced from 30 seconds to 10 seconds to minimize lock hold time when clients disconnect during connection phase 2026-01-04 15:21:22 -06:00
__init__.py Initial integration. 2025-03-03 18:40:30 -06:00
apps.py centralized and lazy-loaded redis client singleton, check for manage.py commands so we don't init proxyservers (redis connection), put manage commmands before starting uwsgi 2025-04-04 16:18:12 -04:00
config.py Enhancement: Update TTL settings for client records and implement periodic refresh during active streaming 2025-10-31 11:53:16 -05:00
signals.py Initial integration. 2025-03-03 18:40:30 -06:00
tasks.py Track VOD connections in Redis. 2025-08-05 21:24:41 -05:00
urls.py Track VOD connections in Redis. 2025-08-05 21:24:41 -05:00
views.py Initial integration. 2025-03-03 18:40:30 -06:00