PITTSBURGH --:--
0720 X 0450 Y
← All projects

Relay

Independent systems study · AI-assisted build · 2026

Event log from the recorded worker-crash experimentProduct preview

A Go and PostgreSQL job queue with worker leases, retries, and a recorded crash-recovery experiment. Built to study what happens between accepting a job and finishing it.

An AI-assisted systems study. The results are from local tests. Delivery is at least once, so external writes still need duplicate protection.

Source publication pending
Implementation notes

Which worker is allowed to finish the job?

Each claim locks a ready row, installs a fresh lease token, and commits before the handler starts. Other workers skip locked rows. A heartbeat renews the lease using database time.

Completion checks both the token and its expiry. A worker that finishes late cannot overwrite the result after another worker has taken the job.

Kill a worker and follow the job through recovery.

The experiment kills a process during a two-second job. Its lease expires, a replacement claims the job, and attempt two succeeds. The old acknowledgement is rejected. In the recorded run, completion took about three seconds after the kill.

Delivery is at least once. Lease tokens protect queue state; a handler that writes to an external service still needs its own way to prevent duplicate effects.

Measure queueing time as well as throughput.

A single-machine burst test processed 3,000 jobs at each configuration: one execution slot, four slots, and twelve slots across three processes. Throughput was about 62, 255, and 862 jobs per second. Each job waited 10 ms and ran 1,000 hash iterations.

These are individual local trials, including submission and queue drain. They are not production capacity figures. The one-slot run had a completion p95 of about 44 seconds. PostgreSQL remains the shared availability dependency.

Years
2026
Type
Systems
Context
Independent systems study · AI-assisted build
Stack
Go, PostgreSQL, HTTP, Docker, GitHub Actions
Links
Source publication pendingAll workContact