DEV Community

Devanshu Biswas
Devanshu Biswas

Posted on

Widen the Worker Pool From 1 to 24 and Every Number the Broker Reports Is Identical. Lost Updates Go 0 to 1,710.

Arc Ops Level 7 is queues and concurrency. 240 tasks, 4 tenants, 8 shared resources, scored against a serial ground truth rather than against the queue's own counters.

Level page: https://dev48.infy.uk/arcops/level7-queues.html · Repo: https://github.com/dev48v/arc-ops

The report that does not move

Widen the worker pool from 1 to 24. Hold everything else. The broker's report is byte-identical at all twenty-four widths:

[483 deliveries, 243 redeliveries, 289 expiries, 46 dead letters,
 6 ..., 194 applied-once, 218 ..., 219 ..., 24 ...]   <- unchanged, 1 through 24
Enter fullscreen mode Exit fullscreen mode

Over those same widths the lost updates go 0 → 1,710 — about 74.35 per extra worker.

The first width at which any broker number moves is 25, which is also the first width where two workers run one message at once. Double executions across the whole identical block: 0. Tasks applied exactly once: 194 at every width.

So every metric the queue can see is measuring delivery, and the damage is in the application.

One worker is the only correct width

And it costs 22.61×: 18,113 ticks against 801.

And one worker has the worst state error on the sweep

This is the part worth sitting with:

workers state error lost updates
1 5,038 (worst) 0
9 914 (best) 606

The perfectly serialised run — the only correct one — ranks last on a scalar "how wrong is the data" metric, because at 9 workers two failure modes with opposite signs cancel. A single error number can invert the ordering it exists to provide.

The dead-letter queue

It holds 46 messages, and all 46 of them ran. The lease-free control reports zero failures and is the only configuration that really loses work — a dead-letter queue is a record of what was retried, not of what did not happen.

One door, proved by parsing all eleven modules with ast: 0 imports of threading/asyncio/queue/time/random/socket, exactly 1 call site taking a message off the queue and 1 changing the world. There is no concurrency in the implementation at all — the interleavings are enumerated.

1,270 tests, standard library only, MIT. 149 verifier asserts, 36 page checks, 0 failures.

Top comments (0)