Fix Frigate faces crash, tracker races, and batch write loss #1

Merged
flan merged 1 commits from fix/repo-review-2026-07-19 into main 2026-07-19 16:53:59 -04:00
Owner

Closes 3 repo-review bugs:

  • eca091d99c42 guard /api/faces response with isinstance(dict) in the shared helper (both callers).
  • 6a8520366644 reentrant cross-process fcntl.flock around every tracker load-mutate-save; held across a batch.
  • 98d37b91e7ae incremental flush every 10 marks; flush_batch releases the lock in finally.

103 tests pass (93+10), ruff clean.

Closes 3 repo-review bugs: - `eca091d99c42` guard /api/faces response with `isinstance(dict)` in the shared helper (both callers). - `6a8520366644` reentrant cross-process `fcntl.flock` around every tracker load-mutate-save; held across a batch. - `98d37b91e7ae` incremental flush every 10 marks; flush_batch releases the lock in `finally`. 103 tests pass (93+10), ruff clean.
flan added 1 commit 2026-07-19 16:50:59 -04:00
- frigate_api._get_faces_data now validates the /api/faces response is a
  dict before returning it, so a malformed body no longer crashes
  data.items() in get_all_frigate_person_files (and the equivalent
  data.get() in get_frigate_person_files).
- upload_tracker now takes an exclusive flock on a DATA_DIR lock file for
  every tracker load-mutate-save cycle, so a scheduled run and a manual
  docker exec against the same DATA_DIR can no longer race a
  read-modify-write and silently drop the loser's marks.
- begin_batch()/flush_batch() now flush to disk every 10 marks instead of
  deferring the whole per-person upload loop, bounding how many uploaded
  marks a crash mid-batch can lose.
flan merged commit 348895294a into main 2026-07-19 16:53:59 -04:00
flan deleted branch fix/repo-review-2026-07-19 2026-07-19 16:53:59 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flan/winnow#1