Preventing Lost Updates on Full-Text Saves with a Line-Level 3-Way Merge

When writers save by replacing a whole document, last-write-wins causes lost updates, and an optimistic-locking conflict error pushes the merge onto every caller. This post does a line-level 3-way merge on the server, using an immutable base snapshot and SELECT … FOR UPDATE.

October 9, 2026 | 5 min

Missing Chunks Cached as SPA Fallback HTML with immutable

After a deploy removed a content-hashed chunk, requests for it fell through to the SPA fallback index.html and were cached as immutable. This post covers a route that returns 404 no-store for missing assets and a recovery bootstrap that cannot reload-loop.

October 8, 2026 | 5 min

UDP connect() Sends Nothing, and getsockname() Gives You Your Local IP

A machine with Wi-Fi, a VPN and a container bridge has several addresses, and a hostname lookup can return the wrong one. Connecting a UDP socket to a destination makes the kernel pick the source address it would use, and getsockname() reads it back without a single packet being sent. Checked on Linux with three interfaces: five destinations, five answers, no IPv4 or ARP frames on the wire.

October 5, 2026 | 10 min

Socket Activation Keeps Connections Waiting, Not Refused, During a systemd Restart

A runbook for replacing a running daemon without dropping requests, tested on a small TCP server under real systemd. A plain restart refused or reset connections every time; starting the new version beside the old one avoided refusals but still reset a connection in some runs, and a kernel setting made those resets go away; socket activation produced no errors. Also covered: draining in-flight work against TimeoutStopSec, and a release swap that checks the new version and rolls back.

October 3, 2026 | 17 min

setsid Doesn't Save a Child Process from systemd

A self-updating daemon that starts an update helper detached with setsid and then restarts its own service loses the helper too, because systemd decides what belongs to a service by cgroup. In the same way, launchd cleans up by process group, and Go’s exec.CommandContext only kills the direct child on cancel. Results and fixes from four trials on a real systemd 257 and a Go experiment with a grandchild process.

September 28, 2026 | 10 min

A Failed Durable Object Alarm Retries 6 Times, Then Stops

A Durable Object has one alarm, a failing alarm is retried up to six times, and then nothing wakes the object. This post builds lease expiry in about 35 lines and checks retry exhaustion and recovery on local workerd.

September 24, 2026 | 9 min

Durable Object Hibernation Keeps the WebSocket and Drops Every Class Field

Cloudflare’s docs say hibernation keeps WebSocket connections open and discards in-memory state. This post runs a small Durable Object under local workerd and watches exactly what that means: the socket stays OPEN, the constructor runs again on the next message, class fields reset, attachments survive only if you serialize them, and a pending timer or the standard WebSocket API quietly turns hibernation off. Production behaviour and billing are not tested.

September 22, 2026 | 13 min

Cancel the Stream, Not the Connection, When One HTTP/2 Request Times Out

A request deadline fired on a connection that carries many requests at once. Do you close the connection, or only the request? In a small Node lab, closing the HTTP/2 session failed two innocent requests, while cancelling only the stream let them finish on the same TCP connection. The same lab shows the one case where cancelling is not enough: a lost packet stalls every stream on a TCP connection, and a connection-level PING is the right way to tell.

September 8, 2026 | 19 min

Waiting for bufferedAmount Protects the Sender, Not a Slow Consumer

WebSocket send() never waits, and bufferedAmount only sees the part of the path that is in your own process. In a small lab, a sender that politely waited for bufferedAmount to drain still let a slow consumer queue nearly all 400 messages in its own memory, while a credit window of 8 kept the backlog at 8. This post goes through four common beliefs about send(), bufferedAmount, message size and backpressure, tests each one, and ends with a table for choosing between them.

September 6, 2026 | 14 min

Resuming an Event Stream with a Cursor, a Bounded Log and a Snapshot

How a client catches up after a reconnect without losing state, without duplicates, and without re-reading history. Built in steps (versions 0 to 4), from “read everything again” to a bounded log with a snapshot fallback, with what a real browser’s EventSource does on reconnect and on a non-200 response, a snapshot-ordering bug, and a decision tree.

September 4, 2026 | 17 min