feat(workers/people): clustering-run observability log #988
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/people-clustering-run-logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds ONE INFO log line per constrained
owner_face_recognitionrun, emitted right before therun_clusteringdispatch:Motivation (incident 2026-10-02)
During the production incident the newly rolled out
anchored-hybridmethod was invisible in logs: the only clustering-related line was "Submitted N class instance candidates for job X" (which does not name the method), andrun_clusteringonly 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
run_clustering(no duplicatedsettings.get)clustering.py(runs stay single-line-per-run from main)test_clustering_registry.py(assertLogsonmain.LOGGER, existing fixture shape) asserting exactly one line with method name, pool, anchor, and tentative countsAdd 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).