From 410696ade376f0826356779653fa1a03409c37ea Mon Sep 17 00:00:00 2001 From: patrykorwat Date: Mon, 24 Aug 2026 10:44:10 +0000 Subject: [PATCH] fix(axelera): overload submits degrade to zero-rows, not raise When the input queue is full, drop the frame's INFERENCE but keep the 1 submission : 1 result contract of AsyncDetectorRunner by emitting an empty (20, 6) result for that connection_id (same pattern the producer already uses when the buffer pool is starved). Raising here used to let a burst of offered frames kill the detect worker and force a restart. Test flipped: queue-full now asserts the zero-row drop instead of the raise. --- frigate/detectors/plugins/axelera.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/frigate/detectors/plugins/axelera.py b/frigate/detectors/plugins/axelera.py index ba302325a9..e1e6a0198d 100644 --- a/frigate/detectors/plugins/axelera.py +++ b/frigate/detectors/plugins/axelera.py @@ -424,13 +424,23 @@ class _AxeleraRuntimeInference: # -- public contract used by AxeleraDetector -------------------------- def submit(self, connection_id: str, frame: np.ndarray) -> None: - """Queue one frame for inference, owned by `connection_id`.""" + """Queue one frame for inference, owned by `connection_id`. + + On overload (input queue full) the frame's INFERENCE is dropped but a + zero-row result is still emitted for `connection_id`: the async runner + contract is strictly 1 submission : 1 result (SHM cleanup + timing + pairing), so raising here would leave the runner waiting for a result + that never arrives. + """ try: self._frame_q.put_nowait((connection_id, frame)) except queue.Full: - raise RuntimeError( - "Axelera inference queue is full; restart required." - ) from None + logger.warning( + "axelera: inference queue full; dropping frame for %s", + connection_id, + ) + self._push_result(connection_id, np.zeros((MAX_ROWS, 6), np.float32)) + return self._ensure_threads() def _ensure_threads(self) -> None: