changelog
An agent follows a slow route from deploy to logs
An agent investigating a slow route must be able to follow the change to the deploy, then inspect the requests in that window. In apps / sockeye, I keep stable record IDs and report what each read leaves out. An agent can't reconstruct a request that I never recorded.
In web / charts, I select one time range across the plots and logs. Selecting buckets sets fixed start and end times in the URL. Links to logs preserve those times and the service filter. The next page shows the interval I selected rather than a moving last hour.
For web / ajax, I send one autosave request at a time for each input. If I pause while a save runs, the client sends the latest text after it finishes. An older response can't replace a newer save.
A retried job must read its own result before it runs again
cmd / sand runs agent tasks from a queue in Postgres. A worker claims a job under a lease and renews the lease while it runs. When a worker crashes, the lease expires and another worker takes the job. Without a check, a retried job publishes the same change twice.
Before the guest boots, the worker opens the change on a branch named
for that job. When the agent finishes, its commit carries a Sand-Job
trailer. A retry reads the trailer at the change's head and skips the
guest when the trailer matches. When someone closes the change, the
worker marks the job for review instead of running the guest again.
At the edge, unix / firewall limits ports 80 and 443
to Cloudflare IP ranges. web / bot prevention drops
probes for /.env, and web / server limits sets a
10-second header timeout. In git / todo, I document my
directory layout for task files.
A Go web service can boot as its own VM
cmd / uni boots one Go web service as a virtual machine guest with no operating system under it. The guest serves HTTP and queries Postgres. It runs no Linux, so it has no shell to log in to. I booted it on a 1-vCPU Ubicloud VM and then on a 2-vCPU one.
A platform patches Linux for me and adds a margin. A plain VM costs less, but I harden it myself. A guest has one binary and one open port. An application bug still hurts, but an attacker who finds it cannot run commands on the host.
In go / test, each test runs inside a rolled-back transaction so it touches no network. Once a week, sockeye clones its git backup to verify the repository, as git / restore rehearsals describes. sockeye also now tracks errors by fingerprint.
Declare the database view once, in Go
go / declarative views moves the SQL of a database view into Go. One list of field declarations generates the view and drives the filter UI, so only one copy of the SQL exists. web / css describes a stylesheet in five layers with a lint for class names. A style change on one page used to break another.
The job queue, pool, and test articles now say how a pool recovers after it loses a database connection, and what to do after editing a migration that already ran.
apps / sockeye changed the most. It is my own git forge, so when a 277 KB diff didn't display, I raised its patch limit to 2 MiB.
A health check must fail when the service is broken
In web / health checks, the health endpoint now reads data that the service uses. That endpoint blocks traffic to a new version until it passes, and it runs every minute after that.
One rule changed in unix / systemd. Each service runs
as its own system user, so app state and credentials stay out of my
home directory. A missing useradd step doesn't matter anymore,
because StateDirectory= makes systemd create the directory.
apps / sports also has a description of the sports content agent.