forked from mtusi2026/mtusi2026lab5
34 lines
3.3 KiB
Plaintext
34 lines
3.3 KiB
Plaintext
# 2026-11-21T15:23:34Z commit=n/a host=Linux 6.18.44-fc-v726 x86_64 cpus=2
|
|
$ python3 student-tests/defense_demo.py
|
|
15:23:35.314 0 chat 4dcdb279-2424-4565-860f-900398e2132e, users alice/bob (tokens not shown)
|
|
15:23:36.054 0 mtusi-lab5-api-1 running started=2026-11-21T15:22:56.56987807Z pid=13005
|
|
15:23:36.054 0 mtusi-lab5-api-2 running started=2026-11-21T15:22:57.106877278Z pid=13141
|
|
15:23:36.054 0 mtusi-lab5-worker-1 running started=2026-11-21T15:22:56.311098593Z pid=12928
|
|
15:23:36.054 0 mtusi-lab5-worker-2 running started=2026-11-21T15:22:56.134737576Z pid=12864
|
|
15:23:36.054 0 mtusi-lab5-nats-1 running started=2026-11-21T15:22:44.137358777Z pid=11928
|
|
15:23:36.054 2 stop worker: docker compose --env-file .env stop worker
|
|
15:23:36.977 2 mtusi-lab5-worker-1 exited started=2026-11-21T15:22:56.311098593Z pid=0
|
|
15:23:36.977 2 mtusi-lab5-worker-2 exited started=2026-11-21T15:22:56.134737576Z pid=0
|
|
15:23:37.015 2 POST /chats/4dcdb279-2424-4565-860f-900398e2132e/attachments → 202, attachment_id=231b3167-1dfb-4345-afbb-6a975d962b9a status=queued
|
|
15:23:37.599 2 job_id=9b6b0860-1c02-4b03-adca-415a8e38091b pipeline_version=1 attempt=1 status=queued
|
|
15:23:37.604 2 GET /attachments/231b3167-1dfb-4345-afbb-6a975d962b9a/content → 409 (conflict)
|
|
15:23:37.612 2 POST message with queued attachment → 201, message_id=db2f3a6f-a88d-4941-b9d7-49079fbd8879
|
|
15:23:37.619 2 POST plain message (bob) → 201, message_id=d67bb40a-754f-40ca-893a-cc157aeb568b; history works while worker is down
|
|
15:23:38.137 2 job published to JetStream: stream_seq=19 (outbox → relay → publish ack)
|
|
15:23:38.137 3 restart broker (volume natsdata kept) and API replicas: restart nats; restart api
|
|
15:23:43.631 3 mtusi-lab5-api-1 running started=2026-11-21T15:23:42.265739366Z pid=17561
|
|
15:23:43.631 3 mtusi-lab5-api-2 running started=2026-11-21T15:23:42.381599065Z pid=17610
|
|
15:23:43.631 3 mtusi-lab5-nats-1 running started=2026-11-21T15:23:38.427620937Z pid=17213
|
|
15:23:43.636 3 after restart: attachment 231b3167-1dfb-4345-afbb-6a975d962b9a status=queued (job survived in PostgreSQL + JetStream)
|
|
15:23:43.636 3 start worker: docker compose --env-file .env start worker
|
|
15:23:47.792 3 attachment 231b3167-1dfb-4345-afbb-6a975d962b9a status=ready 1.0s after worker start; variants=['crop 128x128', 'optimized 320x200', 'thumbnail 256x160']
|
|
15:23:47.901 3 original sha256=c12fddfbf426021c… (= uploaded), thumbnail JPEG (256, 160)
|
|
15:23:48.432 log 15:23:37.012 enqueued attempt=1 token=None {'outbox_id': 14}
|
|
15:23:48.432 log 15:23:37.018 published attempt=1 token=None {'relay': 'api-api-cddd41bd', 'duplicate': False, 'outbox_id': 14, 'stream_seq': 19}
|
|
15:23:48.432 log 15:23:47.045 claimed attempt=1 token=14 {'claims': 1}
|
|
15:23:48.432 log 15:23:47.335 committed attempt=1 token=14 {'variants': ['crop', 'optimized', 'thumbnail']}
|
|
15:23:48.432 log 15:23:47.335 published_version_changed attempt=1 token=14 {'to': 1, 'from': None}
|
|
15:23:48.432 log 15:23:47.341 staging_cleaned attempt=1 token=None {'after': 'ready'}
|
|
PASS: defense scenario (worker down → 202 → 409 → restart API+broker → worker → ready)
|
|
exit=0
|