feat(workers/people): clustering-run observability log #988

Merged
chris merged 1 commit from fix/people-clustering-run-logs into main 2026-10-02 18:21:46 +02:00
Owner

Summary

Adds ONE INFO log line per constrained owner_face_recognition run, emitted right before the run_clustering dispatch:

Clustering run: job=<id> method=<name> pool=<n> anchors=<n> tentative_assigned=<n>

Motivation (incident 2026-10-02)

During the production incident the newly rolled out anchored-hybrid method was invisible in logs: the only clustering-related line was "Submitted N class instance candidates for job X" (which does not name the method), and run_clustering only logs a WARNING for unknown names — a correctly-registered dispatch is entirely silent. In the observed zero-candidate run it was impossible to tell from logs whether anchored-hybrid had executed, nor what the pool/anchor counts were (the decisive diagnostic).

Details

  • Method name resolved once into a variable and passed to run_clustering (no duplicated settings.get)
  • Dispatch behavior, kwargs, return values, and the unknown-name warning unchanged; no extra log in clustering.py (runs stay single-line-per-run from main)
  • One focused handler-level test in test_clustering_registry.py (assertLogs on main.LOGGER, existing fixture shape) asserting exactly one line with method name, pool, anchor, and tentative counts
  • Full worker suite: 142 passed (141 baseline + 1)
## Summary Adds ONE INFO log line per constrained `owner_face_recognition` run, emitted right before the `run_clustering` dispatch: ``` Clustering run: job=<id> method=<name> pool=<n> anchors=<n> tentative_assigned=<n> ``` ## Motivation (incident 2026-10-02) During the production incident the newly rolled out `anchored-hybrid` method was invisible in logs: the only clustering-related line was "Submitted N class instance candidates for job X" (which does not name the method), and `run_clustering` only logs a WARNING for unknown names — a correctly-registered dispatch is entirely silent. In the observed zero-candidate run it was impossible to tell from logs whether anchored-hybrid had executed, nor what the pool/anchor counts were (the decisive diagnostic). ## Details - Method name resolved once into a variable and passed to `run_clustering` (no duplicated `settings.get`) - Dispatch behavior, kwargs, return values, and the unknown-name warning unchanged; no extra log in `clustering.py` (runs stay single-line-per-run from main) - One focused handler-level test in `test_clustering_registry.py` (`assertLogs` on `main.LOGGER`, existing fixture shape) asserting exactly one line with method name, pool, anchor, and tentative counts - Full worker suite: 142 passed (141 baseline + 1)
feat(workers/people): clustering-run observability log
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Run scoped PR tests (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
7df2225277
Add one INFO log line per constrained owner_face_recognition run, emitted
right before the run_clustering dispatch:

  Clustering run: job=<id> method=<name> pool=<n> anchors=<n>
      tentative_assigned=<n>

Motivation: during the 2026-10-02 production incident the newly rolled out
'anchored-hybrid' method was invisible in logs — the only clustering-
related line was "Submitted N class instance candidates for job X", which
does not name the method. In the observed zero-candidate run there was no
way to tell from logs whether anchored-hybrid had actually executed, nor
what the clustering pool / anchor counts were (those two numbers were the
decisive diagnostic). run_clustering only logs a WARNING on unknown names,
so a correctly-registered method dispatch is entirely silent.

The method name is now resolved once into a variable and passed to
run_clustering (no duplicated settings.get). Dispatch behavior, kwargs,
return values, and the unknown-name warning are unchanged; clustering.py
gets no extra log so runs stay single-line-per-run from main.

Test: one focused handler-level case in test_clustering_registry.py
(assertLogs on main.LOGGER, existing _JobClientStub/_job fixture shape)
asserting exactly one "Clustering run:" line containing method name,
pool size, anchor count, and tentative count. Full worker suite:
142 passed (141 baseline + 1).
chris merged commit 344f12a194 into main 2026-10-02 18:21:46 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!988
No description provided.