Skip to content

feat(engine): one heartbeat per camera per minute - #420

Merged
MateoLostanlen merged 4 commits into
developfrom
feat/heartbeat-per-camera
Oct 21, 2026
Merged

MateoLostanlen merged 4 commits into
developfrom
feat/heartbeat-per-camera

Conversation

@MateoLostanlen

@MateoLostanlen MateoLostanlen commented Sep 12, 2026 •

Copy link
Copy Markdown
Member
  • Heartbeats were sent on every pose of every loop, 8 per minute for a 4-pose camera. Fleet-wide that is 7.5 requests per second and 89% of the alert API traffic, for a liveness signal the platform only evaluates with a 30 minute threshold.
  • The engine now sends at most one heartbeat per camera per heartbeat_period (default 60 s), tracked per camera IP on a monotonic clock. Periodic image uploads and mask fetches are unchanged.
  • The SIGALRM heartbeat cutoff is replaced by the per-call request timeout added in feat(client): per-call timeout for heartbeat pyro-api#691 (timeout=1), with any RequestException logged. SIGALRM could fire inside urllib3 and deadlock it (kwartier-west, 2026-09-11). Note this bounds connect and each read, not total wall time (DNS is not covered).
  • Bumps pyroclient to fba2e2c (pyro-api#691 merge).
  • Cuts heartbeat traffic by roughly 8x with no API or platform change.

@MateoLostanlen
MateoLostanlen requested a review from fe51 September 12, 2026 10:22
@codecov

codecov Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.02%. Comparing base (dbf298d) to head (26222d9).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #420      +/-   ##
===========================================
+ Coverage    79.46%   80.02%   +0.56%     
===========================================
  Files            6        6              
  Lines          852      846       -6     
===========================================
  Hits           677      677              
+ Misses         175      169       -6     
Flag Coverage Δ
unittests 80.02% <100.00%> (+0.56%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The SIGALRM cutoff could fire inside urllib3 and deadlock it (kwartier-west,
2026-09-11). pyroclient now takes a per-call heartbeat timeout
(pyronear/pyro-api#691), so the engine passes timeout=1 and catches any
RequestException. Bumps pyroclient to the merged revision.
@MateoLostanlen
MateoLostanlen force-pushed the feat/heartbeat-per-camera branch from df1a5d0 to b47eee4 Compare October 8, 2026 16:19
An unknown camera IP raised KeyError in predict and aborted inference for that frame.
@MateoLostanlen
MateoLostanlen merged commit 3a4b74e into develop Oct 21, 2026
11 checks passed
@MateoLostanlen
MateoLostanlen deleted the feat/heartbeat-per-camera branch October 21, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant