feat: process attachments asynchronously with RabbitMQ and a worker
Upload answers 202 after staging, a queued job in PostgreSQL and a broker confirm; a separate worker publishes the original and a thumbnail with bounded retries. Adds the job and variant tables, the broker service, the worker S3 user, cleanup and reconcile support for staging and variants, the failure stand with broker and worker, bench and driver updates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,9 @@ CAPABILITIES = (
|
||||
# уборщик: все сценарии — проверки отказов (design change
|
||||
# upload-consistency, решение 10)
|
||||
"storage-consistency",
|
||||
# с лабы 5 (design change async-attachments, решение 15)
|
||||
"attachment-processing",
|
||||
"message-broker",
|
||||
)
|
||||
SCENARIO_RE = re.compile(r"^#### Scenario: (.+?)\s*$", re.MULTILINE)
|
||||
|
||||
@@ -151,6 +154,39 @@ EXCLUDED: dict[Scenario, Exclusion] = {
|
||||
"разные хэши одинаковых паролей, пароля нет в pg_dump базы — "
|
||||
"evidence/auth/passwords-and-tokens.md",
|
||||
),
|
||||
("message-broker", "Сервис брокера запущен"): Exclusion(
|
||||
reason="образ, volume и порты контейнера видны только в Docker",
|
||||
check="driver.py --port <LB> broker-check: образ с тегом и digest, "
|
||||
"именованный volume, docker port только AMQP на 127.0.0.1 — "
|
||||
"evidence/broker/stand.md",
|
||||
),
|
||||
("message-broker", "Предел памяти брокера"): Exclusion(
|
||||
reason="предел памяти виден только в статусе брокера",
|
||||
check="driver.py --port <LB> broker-check: предел памяти из "
|
||||
"rabbitmqctl status меньше лимита контейнера — "
|
||||
"evidence/broker/stand.md",
|
||||
),
|
||||
("message-broker", "Остановка брокера"): Exclusion(
|
||||
reason="код выхода и время остановки контейнера видны только в "
|
||||
"Docker, а проверка плавной остановки — на рабочем стенде",
|
||||
check="driver.py --port <LB> broker-check: docker compose stop "
|
||||
"брокера — код 0 раньше срока — evidence/broker/stand.md",
|
||||
),
|
||||
("message-broker", "Очереди разных баз разделены"): Exclusion(
|
||||
reason="прогон на временной базе и взгляд на очереди брокера, а "
|
||||
"набор не знает, на какой базе работает",
|
||||
check="make test_isolated KEEP_TEST_DB=1, driver.py --port <LB> "
|
||||
"broker-check --require-test-queue, make test_isolated: очередь "
|
||||
"временной базы есть после первого прогона и нет после второго — "
|
||||
"evidence/broker/isolated.md",
|
||||
),
|
||||
("data-storage", "Ограничения обработки в схеме"): Exclusion(
|
||||
reason="нужна прямая вставка в таблицы PostgreSQL, а тесты ходят по "
|
||||
"HTTP",
|
||||
check="driver.py --port <LB> attachment-storage: пробы ограничений "
|
||||
"обработки в откатываемой транзакции — "
|
||||
"evidence/attachments/storage.md",
|
||||
),
|
||||
}
|
||||
# ссылка исключения на доказательство в репозитории лабы
|
||||
EVIDENCE_RE = re.compile(r"evidence/[\w./-]+\.md")
|
||||
|
||||
Reference in New Issue
Block a user