Dispatcharr/apps
Josh Becker efad028be1
fix(proxy): reap ghost channel sessions stuck in initializing
A channel initialization that died between the early metadata write and
stream manager creation left immortal 'initializing' metadata: no owner
lock, no URL, no TTL. Every future play request attached to the dead
session and got 'Error: Connection stalled'; failover was never tried;
the orphan sweep never reaped it because it only checked whether the
owner *worker* heartbeat was alive, not whether any worker actually
held the channel ownership lock. The M3U profile connection slot also
leaked (#947).

- Detect ghost sessions (pre-active state, no ownership lock, past the
  init grace period) on play requests and reinitialize instead of
  attaching; check_if_channel_exists() now cleans them up too.
- Mark failed initializations as 'error' (terminal) instead of leaving
  'initializing' behind, and give early init metadata a TTL so any
  missed failure path expires on its own.
- Extend the 30s orphan sweep to reap pre-active channels with no
  ownership lock and no clients after 2x the init grace period, even
  when the owning worker is still alive.
- Cleaning a ghost releases the leaked M3U profile connection slot.

Fixes the ghost-session variant of #669/#695 and the init-failure slot
leak of #947.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 23:08:17 -04:00
..
accounts tests: Move tests to under tests folder. 2026-07-07 18:51:35 +00:00
api feat(timeshift): add catch-up playback, stats, and admin APIs 2026-07-11 17:14:31 +00:00
backups tests: Move tests to under tests folder. 2026-07-07 18:51:35 +00:00
channels feat(timeshift): add catch-up playback, stats, and admin APIs 2026-07-11 17:14:31 +00:00
connect Enhancement: Update plugin discovery logic to include release_connections parameter, improving resource management during event triggering. 2026-07-07 18:25:52 +00:00
dashboard tests: Move tests to under tests folder. 2026-07-07 18:51:35 +00:00
epg feat(epg): add native xz decompression support for EPG sources 2026-07-07 19:48:44 -05:00
hdhr
m3u feat(m3u): add native xz decompression support for uploaded M3U playlists 2026-07-07 19:48:44 -05:00
output fix(epg): prevent crashes for channels with null channel numbers in XMLTV export 2026-07-10 02:42:50 +00:00
plugins Enhancement: Add release_connections parameter to PluginManager, allowing for conditional database connection closure during plugin discovery, improving resource management. 2026-07-07 18:27:15 +00:00
proxy fix(proxy): reap ghost channel sessions stuck in initializing 2026-07-11 23:08:17 -04:00
timeshift fix(timeshift): enhance session matching logic for fresh sessions 2026-07-11 17:32:07 +00:00
vod fix(vod): prevent group selection loss on empty category fetch 2026-07-09 21:26:36 +00:00