forked from mtusi2026/mtusi2026lab6
34 lines
3.3 KiB
Plaintext
34 lines
3.3 KiB
Plaintext
# 2026-11-21T20:04:22Z commit=n/a host=Linux 6.18.44-fc-v726 x86_64 cpus=2
|
|
$ python3 student-tests/defense_demo.py
|
|
20:04:24.055 0 chat 4e63a603-914c-4f47-84d9-6f71057ad639, users alice/bob (tokens not shown)
|
|
20:04:24.835 0 mtusi-lab6-api-1 running started=2026-11-21T19:59:25.880108847Z pid=2790
|
|
20:04:24.835 0 mtusi-lab6-api-2 running started=2026-11-21T19:59:26.237488123Z pid=2867
|
|
20:04:24.835 0 mtusi-lab6-worker-1 running started=2026-11-21T19:59:26.716469278Z pid=2986
|
|
20:04:24.835 0 mtusi-lab6-worker-2 running started=2026-11-21T19:59:27.326051972Z pid=3041
|
|
20:04:24.835 0 mtusi-lab6-nats-1 running started=2026-11-21T19:22:35.290602429Z pid=17585
|
|
20:04:24.835 2 stop worker: docker compose --env-file .env stop worker
|
|
20:04:25.804 2 mtusi-lab6-worker-1 exited started=2026-11-21T19:59:26.716469278Z pid=0
|
|
20:04:25.804 2 mtusi-lab6-worker-2 exited started=2026-11-21T19:59:27.326051972Z pid=0
|
|
20:04:25.844 2 POST /chats/4e63a603-914c-4f47-84d9-6f71057ad639/attachments → 202, attachment_id=5b856079-7c1e-4ee6-af16-55ea0fb2ecd4 status=queued
|
|
20:04:26.655 2 job_id=f921ca14-cc40-4095-b8e2-947cda3536c7 pipeline_version=1 attempt=1 status=queued
|
|
20:04:26.660 2 GET /attachments/5b856079-7c1e-4ee6-af16-55ea0fb2ecd4/content → 409 (conflict)
|
|
20:04:26.669 2 POST message with queued attachment → 201, message_id=b5591933-2e47-4a34-ac47-3fc0e74efa09
|
|
20:04:26.676 2 POST plain message (bob) → 201, message_id=997c604c-7e4e-4905-b77b-1cb751db2d6f; history works while worker is down
|
|
20:04:27.372 2 job published to JetStream: stream_seq=786 (outbox → relay → publish ack)
|
|
20:04:27.372 3 restart broker (volume natsdata kept) and API replicas: restart nats; restart api
|
|
20:04:33.763 3 mtusi-lab6-api-1 running started=2026-11-21T20:04:31.946056134Z pid=25862
|
|
20:04:33.763 3 mtusi-lab6-api-2 running started=2026-11-21T20:04:31.715486281Z pid=25806
|
|
20:04:33.763 3 mtusi-lab6-nats-1 running started=2026-11-21T20:04:27.663048481Z pid=25426
|
|
20:04:33.771 3 after restart: attachment 5b856079-7c1e-4ee6-af16-55ea0fb2ecd4 status=queued (job survived in PostgreSQL + JetStream)
|
|
20:04:33.771 3 start worker: docker compose --env-file .env start worker
|
|
20:04:43.551 3 attachment 5b856079-7c1e-4ee6-af16-55ea0fb2ecd4 status=ready 1.6s after worker start; variants=['crop 128x128', 'optimized 320x200', 'thumbnail 256x160']
|
|
20:04:43.710 3 original sha256=8355144458298115… (= uploaded), thumbnail JPEG (256, 160)
|
|
20:04:44.426 log 20:04:25.840 enqueued attempt=1 token=None {'outbox_id': 744}
|
|
20:04:44.426 log 20:04:25.847 published attempt=1 token=None {'relay': 'api-api-a0e7e8a8', 'duplicate': False, 'outbox_id': 744, 'stream_seq': 786}
|
|
20:04:44.426 log 20:04:43.087 claimed attempt=1 token=779 {'claims': 1}
|
|
20:04:44.426 log 20:04:43.463 committed attempt=1 token=779 {'variants': ['crop', 'optimized', 'thumbnail']}
|
|
20:04:44.426 log 20:04:43.463 published_version_changed attempt=1 token=779 {'to': 1, 'from': None}
|
|
20:04:44.426 log 20:04:43.469 staging_cleaned attempt=1 token=None {'after': 'ready'}
|
|
PASS: defense scenario (worker down → 202 → 409 → restart API+broker → worker → ready)
|
|
exit=0
|