6.9 KiB
6.9 KiB
Шаг 4 сценария защиты: окна отказа
- Команда:
python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 defense-faults - Дата: 2026-10-31, 13:20:45–13:22:52 UTC; итог
PASS - Commit:
e2a6427(веткаfeat/pipeline-reliability), рабочее дерево без правок кода (добавлены только файлыevidence/) - Стенд: проект compose
mtusi-lab5, собранmake run_dockerизHEAD: HAProxy, две реплики API, relay, worker, cleaner, PostgreSQL, Valkey, S3, RabbitMQ - Спек:
student-tests, «Шаг 4 на рабочем стенде»; решения 1, 3, 5, 14, 17 design changepipeline-reliability. Тем же порядком на стенде отказов —test_defense_faults(evidence/tests/failure-checks.md) - Точек сбоя в коде нет: окна держат триггеры
driver_df_*только на уникальныйfilenameпрогона,docker killснаружи. Токенов и секретов в выводе нет, пользователи и чат синтетические - Вывод сокращён: внутри окна строки скачивания вариантов свёрнуты в одну (каждый вариант проверен: 200, тип, размеры по байтам, SHA-256 = метаданным), итоговая таблица «проверка → ожидаемо → получено» без расхождений заменена её итогом
window: after writing objects, before COMMIT
upload: 202
attachment id 9dbedb7b-9884-4122-bbc8-3ee3b3adb278
COMMIT of ready waits in the trigger: yes
action: docker kill worker
job state after kill: processing
attempt after kill: 1
job id 89767628-2179-40d8-9d08-5a882db756e4
thumbnail sha256 before the crash b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546
crop sha256 before the crash fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f
optimized sha256 before the crash 1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb
action: start worker, lease expires in 69 s
attachment status: ready
ready 70 s after the kill
next attempt not before the lease expired: yes
variants in metadata: crop,optimized,thumbnail
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
thumbnail same sha256 in S3 and metadata: b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546
crop same sha256 in S3 and metadata: fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f
optimized same sha256 in S3 and metadata: 1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb
attempt: 2
job state: succeeded
queue empty: 0
window: after COMMIT, before ack
upload: 202
attachment id 5acffd71-f175-4c78-a2ed-58f90a2c27ad
COMMIT waits in the deferred trigger: yes
action: docker kill -s STOP worker
job state while frozen: succeeded
job id 23c4e081-66af-43a8-b9df-3b42508ea890
action: docker kill worker
message returned to the queue (no ack): 1
action: start worker
redelivered: 'Skipped job message', finished: yes
new attempts: 0
queue empty: 0
same updated_at: 2026-10-31T13:22:01.910196+00:00
attempt: 1
metadata unchanged: yes
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
window: after COMMIT queued, before publish
action: docker kill relay
relay stays down: no
upload: 202
attachment id 092f2122-d3de-4034-a8d9-071c070a0f4b
job id 40467883-90e0-4e8a-905a-45ffe36cf2b6
job state: queued
published_at: None
messages in the queue: 0
action: start relay
attachment status: ready
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
attempt: 1
window: after broker confirm, before the mark
action: docker compose stop worker
upload: 202
attachment id ea2e1492-1e1f-4dc3-b2fb-70a87c3c0986
the mark waits in the trigger: yes
action: docker kill relay
message in the queue: 1
job id f81f91fa-6d41-470d-9b27-a4086dc263f2
published_at: None
action: start relay
two messages with the worker stopped: 2
action: start worker
attachment status: ready
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
queue empty: 0
attempt: 1
window: replay of a failed job
action: docker compose stop worker
upload: 202
attachment id f3b0e3cb-fec6-4604-a43f-32a35468ea3a
action: staging object replaced with other bytes of the same size
action: start worker
attachment status: failed
error_code: processing_failed
job id 13665040-1e95-4ad3-b1fc-759bb69322d0
reason: source_corrupted
action: replay --error-code processing_failed (registry, dry-run)
registry: exit 0
registry names the job: yes
registry changes nothing: state failed, attempt 1, attempt_base 0, last_error_code source_corrupted
action: original bytes returned to staging
action: replay --attachment-id f3b0e3cb-fec6-4604-a43f-32a35468ea3a --apply
replay exit code: 0
'Replayed job' record: yes
attachment status: ready
downloads: thumbnail image/jpeg (256, 160); crop image/jpeg (128, 128); optimized image/webp (320, 200)
download original: 200
original sha256 = uploaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
same job: 13665040-1e95-4ad3-b1fc-759bb69322d0
attempt: 2
attempt_base: 1
audit: [{'operator': 'driver-defense-faults', 'error_code': 'processing_failed', 'reason': 'source_corrupted', 'attempt': 1}]
window: replay of a ready job
upload: 202
attachment id 1ac6c769-2b55-4449-ac01-96575e6c6502
attachment status: ready
job id c5a99e2b-2a3e-4ee8-8b53-f557190b1980
action: replay --attachment-id 1ac6c769-2b55-4449-ac01-96575e6c6502 --apply
replay exit code: 3
refusal: already_ready
metadata unchanged: yes
job unchanged: 2026-10-31T13:22:43.535575+00:00
audit records: 0
driver triggers left: 0
window -> action -> job id -> attempts started -> result
after writing objects, before COMMIT -> kill worker, wait for the lease -> 89767628-2179-40d8-9d08-5a882db756e4 -> 2 -> ready
after COMMIT, before ack -> freeze and kill worker after COMMIT -> 23c4e081-66af-43a8-b9df-3b42508ea890 -> 1 -> ready, no-op
after COMMIT queued, before publish -> kill relay, upload, start relay -> 40467883-90e0-4e8a-905a-45ffe36cf2b6 -> 1 -> ready
after broker confirm, before the mark -> kill relay after confirm, duplicate -> f81f91fa-6d41-470d-9b27-a4086dc263f2 -> 1 -> ready
replay of a failed job -> failed, registry, replay -> 13665040-1e95-4ad3-b1fc-759bb69322d0 -> 2 -> ready
replay of a ready job -> replay ready -> c5a99e2b-2a3e-4ee8-8b53-f557190b1980 -> 1 -> refused, exit 3
all rows of the check table: expected = got
PASS: every window finished with the same result, no duplicate effect
worker and relay running at the end: yes