From 601a9d8545de9a5257884aa3116501d134393ecd Mon Sep 17 00:00:00 2001 From: ginnoir Date: Fri, 9 Oct 2026 00:23:58 -0500 Subject: [PATCH] fix(cameras): neolink healthcheck probes 300 main-stream buffers A stalled neolink still bursts ~30 buffered packets on connect, so the 30-buffer sub-stream probe passed for an hour while Frigate crash-looped. Healthy main stream delivers 300 buffers in ~4 s. Co-Authored-By: Claude Opus 5.5 --- stacks/cameras/docker-compose.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stacks/cameras/docker-compose.yml b/stacks/cameras/docker-compose.yml index 364090a..50f733a 100644 --- a/stacks/cameras/docker-compose.yml +++ b/stacks/cameras/docker-compose.yml @@ -46,15 +46,17 @@ services: - /config/neolink/neolink.toml:/etc/neolink.toml:ro # neolink can wedge without exiting ("Remaining: 0 of 100 message space"): RTSP stays # up but serves no frames, so Frigate shows the stream offline forever (2026-10-08). - # Probe: pull 30 RTP buffers off the sub stream. After 3 straight failures, SIGKILL + # A stalled stream still bursts ~30 buffered packets on connect, so 30 was a false pass + # for an hour (2026-10-09). Probe: pull 300 RTP buffers off the main stream (~4 s when + # healthy, ~80 pkt/s). After 3 straight failures, SIGKILL # neolink; the image's sh PID 1 then exits and `restart: unless-stopped` brings it back. healthcheck: test: - CMD-SHELL - >- f=/tmp/hc-fails; - if timeout 20 gst-launch-1.0 -q rtspsrc location=rtsp://127.0.0.1:8554/e1/subStream protocols=tcp - ! identity eos-after=30 ! fakesink >/dev/null 2>&1; then echo 0 > $$f; exit 0; fi; + if timeout 20 gst-launch-1.0 -q rtspsrc location=rtsp://127.0.0.1:8554/e1/mainStream protocols=tcp + ! identity eos-after=300 ! fakesink >/dev/null 2>&1; then echo 0 > $$f; exit 0; fi; n=$$(( $$(cat $$f 2>/dev/null || echo 0) + 1 )); echo $$n > $$f; if [ $$n -ge 3 ]; then echo 0 > $$f; for p in /proc/[0-9]*; do [ "$$(cat $$p/comm 2>/dev/null)" = neolink ] && kill -9 $${p#/proc/}; done; fi;