Back to All Posts

#concurrency

tuckerl.ee

Building thoughtful software with AI.Notes from the systems behind the work.

Also new

article

A supplier setup lease that trusted a name tag and the worker's own clock

The lease guarding my long supplier setup job only checked the owner's name, judged expiry by each worker's clock, and never renewed during slow phases. Now every claim bumps a fencing token, every write checks it against the database's clock, the phase-advancing writes also check the phase they expect to leave, and a heartbeat keeps slow work alive.

The button that saves a delivery as a draft in the stores' inventory system checked first and wrote its record only after a slow outside call, so a second click could slip through. Now it claims the delivery in the database first, lets a partial unique index refuse the second claim, fixes a payload hash that couldn't see nested fields, and adds a narrow admin cancel for claims that get stuck.

article

Device limit counts first and saves later, and the test never sends two at once

The licensing code I shipped checks how many devices a key already has, then inserts the new one in a separate step, so two activations racing for the last slot can both get in. The test activates devices one at a time and can't see it, a device racing itself gets a server error, and a key-only check passes for keys never bound anywhere. I found this by reading, not by running anything concurrent.

article

The live site's config gets rewritten when the admin test button runs

The agent gave my chore app a test runner that saves the config and puts it back after every test, then wired it to an admin button on the live server. It looks clean at the end of a run, but reading the code, visitors could get test settings mid-run, two overlapping runs could delete the real config and still report green, and a killed run loses the only saved copy.