fix(daemon): defensive IsClosed check in watchSessionReady poll loop
Closes the deferred bajo-priority item from the fase 3.3b critico.
Without this the watcher kept polling a torn-down HLSSession for up
to 60 s — fine in current code paths (Close always pairs with ctx
cancel which makes the select{} branch fire), but the function's
correctness then leaned on a caller invariant rather than its own
state check. Adding IsClosed() as a public wrapper around the
existing isClosed() lets the watcher detect any future
session-shutdown path (registry replace, idle sweep, internal kill)
without touching the unexported helper.
This commit is contained in:
parent
69fff32420
commit
54932b1ac2
2 changed files with 14 additions and 0 deletions
|
|
@ -534,6 +534,13 @@ func (s *HLSSession) ReadyCount() int {
|
|||
// circuit polling — a cache HIT is ready the moment we return.
|
||||
func (s *HLSSession) FromCache() bool { return s.fromCache }
|
||||
|
||||
// IsClosed reports whether Close() has been invoked. Exposed (vs the
|
||||
// internal isClosed) so external watchers — the ready-webhook
|
||||
// goroutine in cmd/daemon.go — can short-circuit polling on a session
|
||||
// that was torn down through a different code path (registry replace,
|
||||
// idle sweep) without racing on the unexported helper.
|
||||
func (s *HLSSession) IsClosed() bool { return s.isClosed() }
|
||||
|
||||
// MasterPlaylist returns the rendered master.m3u8 contents.
|
||||
func (s *HLSSession) MasterPlaylist() string { return s.manifestRoot }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue