The poller crashed on every S3 or DB error (1162 restarts during the
fsn1 object storage degradation on 2026-09-21). Now:
- main loop catches errors per cycle, classifies them (S3 5xx/throttling,
connection/timeouts, psycopg.OperationalError = transient; everything
else logged with traceback) and retries with exponential backoff
(5 s .. 5 min, reset after success); db_init runs until it succeeds once
- explicit botocore config for the poller: connect/read timeouts, standard
retries (total attempts), s3v4, path addressing; S3(cfg) without a
config keeps the previous client for the Gundi path
- DB connect timeout + TCP keepalives
- one S3 client per cycle shared by all workers
- a batch stops after a transient S3/DB error (image stays ERROR as before)
- no busy loop when ready sets keep failing
- [HEARTBEAT] log line with counters, heartbeat file + Docker healthcheck
- tools/entrance_inventory.py: read-only listing of icu/entrance orphans
- unit tests with simulated S3/DB failures
Per-image transaction, status names/order, keys and paths are unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>