feat: add job outbox, relay, leases and image variants to the pipeline

Move publishing out of the upload path: a relay process publishes queued
jobs with confirms. Add lease and attempt fencing, backoff with jitter, a
per-job render process with CPU and memory limits, crop and optimized
variants, the failed registry with audited replay, and staging cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 15:36:15 +03:00
co-authored by Claude Opus 5.5
parent 99a222eee2
commit e2a6427c24
102 changed files with 9499 additions and 1916 deletions
+19 -4
View File
@@ -125,10 +125,25 @@ failed» с traceback. Модуль `worker`: «Started worker» со всеми
«Stopped worker» с `exit_code`, «Invalid worker settings» мимо structlog, «Stopped
worker before startup». Модуль `broker`: `warning` «Broker is unavailable»,
`info` «Broker is available again», `debug` на публикацию; API: «Uploaded attachment»
— ещё `job_id`, `warning` «Attachment job was not published» (`outcome`:
`cancelled`, `taken`), «Attachment job publish mark failed». «Started API» — ещё
`broker_host`, `broker_port`, `broker_queue`, `broker_publish_timeout_seconds`.
Пароля брокера и тел сообщений в записях нет.
— ещё `job_id`, `content_type` значением. Пароля брокера и тел сообщений в записях нет.
С change `pipeline-reliability` (решение 18): «Started job attempt» — ещё `queue_wait_ms`
(от подтверждения брокером до взятия), `message_attempt`, `redelivered`; «Attachment
became ready» — вместо `variant_*` — `variants` (имя, ширина, высота, размер), `render_ms`,
`render_peak_kib`, `render_memory_limit_applied`, `duration_ms`; «Retrying job» — ещё
`next_attempt_at`; «Skipped job message» — ещё `not_due`, `superseded`. Модуль
`image_renderer`: `warning` «Render process failed» (`exit_code`), «Render process output
is damaged». Модуль `relay`: «Started relay» со всеми значениями, «Stopped relay»,
«Invalid relay settings», «Stopped relay before startup», `warning` «Relay pass was
interrupted», `error` «Relay pass failed». Модуль `attachment_relay_service`: «Relay
pass» (`published`, `unconfirmed`, `recovered`, `republished`, `published_backlog`,
`duration_ms`; `info`, пустой — `debug`), `warning` «Recovered expired lease», `info`
«Relay backlog is full» / «Relay backlog has room» на смену состояния. Модуль
`attachment_replay_service`: «Found failed job», «Replayed job» (`operator`, прежние
`error_code`, `reason`), `warning` «Refused job replay» (`refusal`), «Finished replay
pass». Модуль `attachment_cleanup_service`: «Finished staging cleanup pass»
(`removed_ready`, `removed_failed`, `skipped`, `interrupted_by`, `duration_ms`), `warning`
«Staging key is not own». Итог сверки — ещё `listed_staging`.
## Чего в логах быть не должно