Files
ArtyomandClaude Opus 5.5 1210dd899c Carry over the agent context and openspec history from lab 4
Bring the Claude Code settings, the lint hook, the opsx commands and
skills, the architecture notes, the lab 1 to lab 4 specs and the
archived lab 1 to lab 4 changes into the lab 5 skeleton, so lab 5
continues the same spec history instead of starting from scratch. The
files come from the lab 4 solution commit d2744bc.

Rewrite AGENTS.md and the openspec context and rules for lab 5: upload
answers 202 queued after the original is in a private staging prefix
and the attachment, the job and the outbox row are committed in one
transaction, a separate relay publishes the outbox to RabbitMQ with
publisher confirms, a separate worker built from the same image
consumes the queue through FastStream with a manual ack after the
result commit, PostgreSQL stays the source of truth for job states,
Out of scope moves to labs 6-7, track 1 and broker HA, and the rules
add the failure windows between PostgreSQL and the broker, the effect
key and the lease to specs and designs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 00:32:37 +03:00

2.4 KiB

MODIFIED Requirements

Requirement: Корректное завершение по сигналу

По получении SIGTERM сервис SHALL сначала выйти из ротации: на время окна DRAIN_SECONDS (по умолчанию 2 с, больше максимального времени обнаружения балансировщиком) /health/ready SHALL отвечать 503 unavailable, а принятые и новые запросы SHALL обслуживаться как обычно. После окна сервис SHALL перестать принимать новые соединения, дождаться завершения принятых запросов и завершить процесс; весь срок, включая окно, SHALL укладываться в SHUTDOWN_TIMEOUT_SECONDS (по умолчанию 5 с), который меньше таймаута хука остановки, stop_grace_period контейнера и 10 секунд, чтобы контейнер не убивался по таймауту. Процесс сервера SHALL быть основным процессом контейнера и SHALL получать сигналы напрямую.

Scenario: Остановка укладывается в срок

  • WHEN запущенному контейнеру послан SIGTERM
  • THEN процесс завершается не позднее чем через 10 секунд и раньше stop_grace_period
  • AND код завершения соответствует штатной остановке, а не убийству по таймауту

Scenario: Сначала вывод из ротации

  • WHEN процессу сервера послан SIGTERM
  • THEN в течение окна DRAIN_SECONDS /health/ready отвечает 503 в общем формате ошибки, /health/live — 200, соединения ещё принимаются, а после окна порт закрыт и процесс завершается с кодом 0 не позднее SHUTDOWN_TIMEOUT_SECONDS

Scenario: Принятый запрос дорабатывается

  • WHEN SIGTERM приходит во время обработки принятого запроса
  • THEN этот запрос получает ответ до завершения процесса