This commit is contained in:
Матвей
2026-10-27 12:24:31 +03:00
parent a1bb6f8bde
commit 6bc0712c2c
27 changed files with 16362 additions and 86 deletions
+11
View File
@@ -118,6 +118,17 @@ async def process_locked(store: PostgresStore, s3: S3Store, payload: dict, lease
metadata.append({"name": name, "object_key": object_key, "content_type": content_type,
"size_bytes": len(content), "width": width, "height": height,
"sha256": sha256(content).hexdigest()})
# Explicit, opt-in integration fault. Marker survives container restart,
# so one crash exercises lease recovery without a permanent crash loop.
if os.environ.get('WORKER_FAULT_AFTER_S3_PUT') == '1':
marker = Path('/tmp/worker-fault-after-s3')
try:
with marker.open('x') as stream:
stream.write(str(attachment_id))
except FileExistsError:
pass
else:
os._exit(70)
committed = await store.complete_attachment_job(attachment_id, original_key, metadata, attachment['claim_time'])
if committed:
try: