Summary
In HubEndpoint._handle_registration, if a connector re-registers and the new ShmRingBuffer(name=reg.shm_name, create=False) reopen raises, self._ring_registry[reg.connector_id] is never reassigned and keeps pointing at the just-closed old_ring. That connector then fails every subsequent FRAME_SIGNAL (read_slot on a released buffer, caught by _dispatch) and never recovers — a stuck, stale-closed registry entry.
Context
Surfaced during review of #202 (which fixed the use-after-close / BufferError by releasing exported SlotView memoryviews before old_ring.close()). That fix is correct; this is a separate, pre-existing edge case noted for follow-up — out of scope for #202.
Post-#202 the failure mode degrades from #197-style corruption to a caught error, but the connector is still permanently broken until it re-registers again, because the registry entry points at a closed ring.
Location
server-runtime/xr_media_hub/ipc/_hub.py — _handle_registration, around the ShmRingBuffer(..., create=False) reopen (~L348).
Suggested fix
On reopen failure, pop the stale _ring_registry[reg.connector_id] entry (and any related per-connector state) so the connector isn't left bound to a closed ring — or reopen into a local first and only swap into the registry once construction succeeds.
Severity
Low — requires a reopen failure during connector re-registration (crash/reconnect path). No data corruption (caught), but the affected connector is stuck until it registers anew.
Summary
In
HubEndpoint._handle_registration, if a connector re-registers and the newShmRingBuffer(name=reg.shm_name, create=False)reopen raises,self._ring_registry[reg.connector_id]is never reassigned and keeps pointing at the just-closedold_ring. That connector then fails every subsequentFRAME_SIGNAL(read_sloton a released buffer, caught by_dispatch) and never recovers — a stuck, stale-closed registry entry.Context
Surfaced during review of #202 (which fixed the use-after-close /
BufferErrorby releasing exportedSlotViewmemoryviews beforeold_ring.close()). That fix is correct; this is a separate, pre-existing edge case noted for follow-up — out of scope for #202.Post-#202 the failure mode degrades from #197-style corruption to a caught error, but the connector is still permanently broken until it re-registers again, because the registry entry points at a closed ring.
Location
server-runtime/xr_media_hub/ipc/_hub.py—_handle_registration, around theShmRingBuffer(..., create=False)reopen (~L348).Suggested fix
On reopen failure,
popthe stale_ring_registry[reg.connector_id]entry (and any related per-connector state) so the connector isn't left bound to a closed ring — or reopen into a local first and only swap into the registry once construction succeeds.Severity
Low — requires a reopen failure during connector re-registration (crash/reconnect path). No data corruption (caught), but the affected connector is stuck until it registers anew.