Skip to main content
El Diario · Chapter 30

I called a commit THE FIX and it lasted 37 minutes

by Jacobo González JaspeLeer en español

If anyone ever wants to know what learning to build systems without having studied for it is really like, they don't need to read this whole diary. The log from 29 April 2026 will do, and I reproduce it with its exact times.

The moment it broke

My orchestrator, the program that coordinates all the agents, was dying on its own. Not with an elegant error. With a SIGSEGV, which is a computer's way of telling you the process did something so improper that the operating system escorted it out of the building without letting it collect its things.

The cause was boring and classic: too many parts of my system trying to write to the same SQLite database at once. SQLite is a wonderful and very honest database which, underneath, is a file. And a file only lets one writer in at a time. I had forty-odd autonomous loops, every one of them convinced it was the only one. I had built a beautiful library and given fifty people the same key to the same drawer.

The alphabet of panic

Here is the sequence, as committed:

08:19  docs(spec): orch startup DDL ordering — fix recurring SIGSEGV
08:51  feat(orch): Phase E — process-wide writer mutex + slow-write telemetry
08:59  fix(orch):  Phase F — TaskStore shares the process writer mutex
09:06  fix(orch):  Phase G — 5 stores share writer mutex (full coverage)
09:10  fix(orch):  Phase H — mass-disable 32 non-critical loops
09:24  docs:       Phase I plan — shared-connection-per-DB architecture
10:24  docs:       writer-mutex deadlock design + verification matrix
10:32  plan:       writer-mutex deadlock fix implementation
12:18  fix(orch):  Phase I — single shared sqlite3.Connection per DB (THE FIX)
12:55  Revert "fix(orch): Phase I — single shared sqlite3.Connection per DB (THE FIX)"

Thirty-seven minutes.

Look at the times. Phase E at 08:51. Phase F at 08:59. Eight minutes. Phase G at 09:06. Seven more. Phase H at 09:10. Four. That isn't debugging. That's panic with a naming convention.

A person who is genuinely diagnosing makes a change, puts it under load, watches whether the problem returns, and waits. I was changing my system's architecture every seven minutes and giving each attempt a new letter, because giving it a letter made it look like a plan. It wasn't a plan. It was the same hunch in five consecutive disguises, and the letters were for me, so I could tell myself "you're on G, you're making progress", when what I was doing was going in circles.

And then there is Phase H, which is my favourite and the one I like least:

09:10  fix(orch): Phase H — mass-disable 32 non-critical loops

I switched off thirty-two parts of my own system. I called them "non-critical". I had built every one of those thirty-two myself, weeks earlier, convinced they were needed. At ten past nine on a Wednesday morning, all of them turned out to be dispensable. It's astonishing how quickly a feature becomes optional when the alternative is that nothing starts at all.

Kitchens know this one. When the pass jams on a Saturday night you don't redesign the menu. You pull dishes. The three slowest, gone, and nobody misses them until Monday. Phase H was exactly that. It just took me another four hours to notice I had already done the useful thing at 09:10.

The hour that helped

Between 09:24 and 10:32 there isn't a single code change. There is this:

09:24  docs: Phase I plan — shared-connection-per-DB architecture
10:24  docs: writer-mutex deadlock design + verification matrix
10:32  plan: writer-mutex deadlock fix implementation

A full hour writing instead of touching. A plan, a design and (this is the important one) a verification matrix: the list of things that would have to be true before I could say the problem was solved. Of the whole day, that is the only stretch in which I behaved like someone who knows what he's doing. It wasn't talent. After four letters of the alphabet I had run out of hunches, and when you run out of hunches all that's left is thinking.

The capitals

At 12:18 Phase I arrived, and I was so sure, so absolutely convinced I had finally understood it, that I did what a man at the summit of his confidence does: I wrote it in capitals.

Phase I — single shared sqlite3.Connection per DB (THE FIX)

THE FIX. Not a fix. The fix. At 12:55 I reverted it. There isn't much more to say about that, except that ever since, whenever I get intense about a technical decision, someone close to me only has to say "the fix" and the discussion is over.

What I measured

WhatHow much
Named phases in one dayFive (E, F, G, H, I)
Average gap between phases E and HAbout seven minutes
Loops switched off in one commit32
Lifetime of THE FIX37 minutes (12:18 to 12:55)
Stretch with no code changes09:24 to 10:32, all planning

What actually fixed it

The story could end at the revert and it would be a joke. But the log continues, and what comes next is the only thing about that day that genuinely interests me. After working halfway up the scale looking for one big elegant solution that would fix everything at once, I abandoned it, went back to the letter A and started doing small, boring, specific things:

11:59  fix(orch):  Phase A — stop the SQLite lock storm
12:03  fix(orch):  Phase B — kill the EvidenceStore + KBStore per-call leaks
13:02  fix(orch):  Phase C-lite — close dag_api stores on shutdown

Phases A, B and C, with times later than E, F, G and H. I went back to the beginning of the alphabet. None of those three is impressive. None of them deserves capitals. And they are the ones that worked. The system has been running since.

Where it still breaks

SQLite is still a file and still lets one writer in at a time. I didn't change databases; I changed habits. Every store closes its connection on shutdown, the loops that aren't needed don't exist (not "disabled": gone), and when the orchestrator falls over, the first thing I open is the plan, not the editor. The Phase I temptation is still there, though. Every time I read about a more elegant architecture, part of me wants to write it in capitals.

What I'd do differently

I would stop trying to be the man who finds THE FIX. I wanted the elegant fix, the one that proves you understood the problem at a deep level. Reality nearly always asks you for three ugly, small things with no narrative value at all. What fixes things is almost never what you wanted to fix them. I ended up being the man who closed his connections properly on shutdown.

Concretely: when the system is on fire, stop the lock storm, close the leaks in front of you, and write the plan before the next letter. And if you ever catch yourself writing a commit message in capitals, check the clock. You have probably not eaten for four hours.

Run it yourself. The whole stack above is open source and runs on one box. If you are doing this for a company (compliance, sizing, a quote), that side of J4SGON lives at vorluxai.com. Creators: the live suite and streams are at j4sgon.com and youtube.com/@J4S_GON.

el-diarioorchestrationsqlitefailures