lab5: исправления по ревью

Concurrent complete no longer deletes the shared verified source; admission is atomic and covers pending presign rows; relay reconciles queued jobs lost to dead-lettering; failed staging is protected until failed_retention; timestamps normalized to UTC; reprocess prefers the durable original and keeps job->attachment lock order; heartbeat errors no longer burn attempts; confirm timeout enforced; pinned images and sanitized health responses.
This commit is contained in:
Vladislav Kunetskiy
2026-10-30 23:13:44 +03:00
parent 4bdcac3dfa
commit 9d7a0acb5a
40 changed files with 592 additions and 521 deletions
+10 -1
View File
@@ -110,6 +110,8 @@ def scenario_transient_exhaustion(client, alice, chat):
attached, _ = client.attachment(alice, chat)
jid = job_id(attached['id'])
dlq_before = queue_messages('attachment.process.dead')
worker_with(
FAULTS_ENABLED='1', FAULT_TARGET_JOB=jid, FAULT_WORKER_FAIL='transient',
PROCESSING_RETRY_BASE='100ms', PROCESSING_RETRY_CAP='500ms',
@@ -120,7 +122,14 @@ def scenario_transient_exhaustion(client, alice, chat):
events = psql("select event || ':' || coalesce(attempt,0) from attachment_job_events where job_id='%s' order by id" % jid)
check(events.count('retried:') == 4, 'expected four managed retries: ' + events)
check(events.count('failed:') == 1, 'expected one terminal failure: ' + events)
check(queue_messages('attachment.process.dead') >= 1, 'terminal failure did not reach the DLQ')
deadline = time.monotonic() + 15
while time.monotonic() < deadline:
if queue_messages('attachment.process.dead') >= dlq_before + 1:
break
time.sleep(0.2)
check(queue_messages('attachment.process.dead') >= dlq_before + 1,
'terminal failure did not add a DLQ message')
print('transient exhaustion: attempts=5, retry_exhausted, four retries, DLQ message present')
reset_worker()