fix(api): register worker result handlers as Spring beans (registry was empty in prod) #1498
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/worker-result-handler-beans"
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?
Prod outage — every worker result submission 400s since deploy 0.67.421
Symptom: Since the API deploy 2026-11-12 18:14, ALL worker result submissions fail with
400 Unknown or unsupported result type: <type>— forclass_instance_candidateAND the fallbackissue(people worker), and for media-worker results too. Evidence: 0 rows inworker_job_resultssince deploy vs 2 613 in the prior 24h. owner_face_recognition attempts fail at the submit step; face clustering is effectively down.Root cause: PR #1493 (commit
9c3d1809, 'WorkerResultService splittet — ét handler-objekt per resultattype') moved result-type persistence into 15WorkerResultHandlerclasses — none registered as Spring beans — and madeWorkerResultServicebuild its handler registry from an@Autowired List<WorkerResultHandler>. Spring injects an empty list → empty registry → every result type rejected. The API starts healthy (UP), so nothing surfaces until workers submit. Tests stayed green because the suite wires the service via the explicit-list fixture constructor, bypassing Spring collection.Fix: Single
@Configuration(WorkerResultHandlerConfiguration) exposing 15@Beanmethods — wiring mirrorsWorkerResultService.productionHandlers(...)exactly (javadoc cross-references it). Nested handlers (Thumbnail/Backfill) are covered by the same factory.Validation:
./gradlew :apps:api:test --tests 'dev.memories.api.worker.*'— 28 test classes green incl. newWorkerResultHandlerConfigurationTest(asserts 15 beans produced;class_instance_candidateandissueresolve; every producedresultType()present without duplicates). Runs green against the pre-fix state by construction (no configuration class → no beans → assertions fail).After merge: requeue the failed
owner_face_recognitionjob(s); worker rerun will submit normally.