mirror of
https://github.com/livekit/livekit.git
synced 2026-10-15 15:30:14 +00:00
LoadIngress reads the ingress info and its state from two separate Redis keys non-atomically, while DeleteIngress removes both keys in a single transaction. If the delete lands between the two reads, LoadIngress returns an IngressInfo with a nil State and no error, and UpdateIngressState panics dereferencing info.State.Status — taking down the whole server with every room it hosts. The race fires in practice when an ingress session is being torn down by DeleteIngress and the ingress service reports the session state change concurrently: with short-lived per-room WHIP ingresses this crashed production servers within minutes (observed on v1.13.5 and v1.13.6, SIGSEGV at ioservice_ingress.go:82, addr=0x8). Guard the nil State by treating it as an empty state, matching how the store's UpdateIngressState already tolerates a missing state key.