moq-hls: Server broadcaster map never evicts (dead ENDLIST after republish, unbounded memory)
## Summary
`Server`'s broadcaster map is insert-only (`rs/moq-hls/src/server/mod.rs:35,59` on main): `broadcasters: Mutex<HashMap<String, Arc<Broadcaster>>>` with a get-or-insert and no removal path. When the source broadcast ends, the pumps finish the store and the playlist gains `#EXT-X-ENDLIST`, but the `Broadcaster` (with its full ~16s window of segment bytes per rendition) stays in the map.
## Impact
1. **Functional:** a publisher disconnects and republishes the same name; `broadcaster(name)` returns the cached dead instance and every viewer gets a finished playlist until the process restarts.
2. **Memory:** rotating broadcast names (per-session IDs) grow the map without bound on a long-running exporter.
## Suggested fix
Evict the entry when the source broadcast ends (the pumps already observe that), or key by broadcast instance so a republish creates a fresh Broadcaster, plus an idle TTL for the memory case.
Found during a full review of the dev branch; verified on main.
(Written by Claude Fable 5)
1 条评论