The server no longer waits for git
When the configuration is saved, checked or makes a repository restart its agents, the Obeya server used to run its git calls one after the other and answer nothing meanwhile. The board looked frozen. Now git runs without blocking the server: all repositories are read at once, and the server keeps answering throughout.
Longest time the server answered nothing
A scratch Obeya with 6 canvases and 9 repositories, the code before (main) and after this change side by side. A request every few milliseconds; the longest wait for an answer during each action. Median of 5 runs.
What this means on a real machine
The scratch repositories are tiny and the machine was idle, so each git call took a few
milliseconds. On the owner's Mac, with large repositories and agents at work, each call took
around 100 ms: stalls.log recorded 19 server freezes between 2 and 5 November,
up to 4.7 s, when a save re-read every repository of every canvas. These freezes came from
the code paths changed here; none of them waits for git any more.
What changed
- Saving the configuration reads all repositories of all canvases at once in the background, then applies them in one go. Saves that follow quickly apply one after the other.
- Checking the configuration (opening the dialog) reads the repository's origin URL together with everything else, instead of asking git again for each repository.
- A repository's agents restarting (after its clones or workspaces change) start once git has read it. Clones it still has to make join the pool when they are made, and cards wait for a free one meanwhile.
- Starting Obeya: canvases start the same way, and their Lesestands (the read-only copy each repository's plan docs are read from) are set up before the board reads from them.
- Confirming a repository's commands ("trust") reads its settings without blocking.
- The GitHub login for other machines is fetched in the background from the start and refreshed every 10 minutes, the previous one standing meanwhile.
The numbers
Spawning processes as such was checked as well: on an idle Mac, starting a git process takes about 0.16 ms, and Obeya already starts at most four per turn of the event loop, so the server gets to answer in between. With fewer git calls overall, that cost shrinks too.