fleet-memory/hindsight-api/hindsight_api/worker
Nicolò Boschi c2876490df
fix: resolve consolidation deadlock caused by zombie processing tasks on retry (#463)
* fix: resolve consolidation deadlock caused by zombie 'processing' tasks on retry

When a task failed and was rescheduled for retry, submit_task() only updated
task_payload without resetting status/worker_id/claimed_at. The task stayed
permanently in 'processing', blocking all future consolidation for that bank
via the NOT EXISTS guard in claim_batch().

Fix: remove the duplicate payload-based retry mechanism from execute_task().
Retryable failures now re-raise so the poller handles them via _retry_or_fail(),
which already correctly resets status='pending', worker_id=NULL, claimed_at=NULL
and uses the DB retry_count column as single source of truth.

Non-retryable tasks (file_convert_retain) continue to mark themselves failed
and return normally — no exception reaches the poller.

Tests: add regression tests for the retry path (status reset to pending) and
the max-retries exhaustion path (status set to failed).

* ci: re-trigger CI
2026-03-02 11:45:41 +01:00
..
__init__.py feat: new 'worker' service (#176) 2026-01-20 10:17:56 +01:00
main.py Fix: load operation validator extension in worker process (#280) 2026-02-02 14:45:40 -05:00
poller.py fix: resolve consolidation deadlock caused by zombie processing tasks on retry (#463) 2026-03-02 11:45:41 +01:00