Skip to content
pi-c Timeline
Login

Timeline

Parents and children of check-in [207faa4c67]

2026-11-21
13:04
Shared journal store: a new journal turns WAL under the exclusive lock; test signal order

shared.sh: the neighbour pic appended its ledger line after signalling that it was holding, so on a slow runner the line could land after the test had cleared the ledger (after-started:2 saw 1 line, expected 0). It now writes the line first.

store.c: PRAGMA journal_mode=WAL ran in every open. SQLite does not wait for other connections when changing the journal mode, so four pics creating one journal at once could fail with 'database is locked' (about 1 in 160 under load). The change of mode now happens only while creating or migrating, with the journal lock held exclusively. closed check-in: 9c7e0c5485 user: dmestas tags: shared-store

12:30
Shared journal store: review fixes

pic import reads all of its input, and import --claude loads the transcript into temporary tables, before the write transaction begins: every open takes the write lock for a moment, so one held across a slow pipe stalled every pic that started.

A file counts as changed by another conversation only for changes journaled since this process took the request up, so one pic never sees it, forks included. A request pic run passes over for its model gives its lease back. A branch summary also leases the conversation its request is journaled under. Recovery for a lease taken inside the admitting transaction joins that transaction. Looking at who holds a lease takes the lock shared, and a taker rides out a look. Lease files are never removed. A named conversation in use is refused before its hooks run. Recovery reads surface errors.

shared.sh: slow import beside other pics, model-skip lease, lone fork, no hooks for a refused prompt, symlinked journal, two-calls-in-a-turn matrix. check-in: 207faa4c67 user: dmestas tags: shared-store

12:03
Shared journal store: several pic processes on one workspace, one conversation each

Each conversation has a lease (an exclusive flock beside the journal) that its process holds while it advances it and that the kernel drops when the process and its forked children are gone. Taking a lease claims the conversation's request and settles what a dead owner left; open recovers only conversations whose lease is free. The journal lock is held shared and taken exclusive only to create or migrate the schema. SQLite runs in normal locking mode with the fair busy handler; dev builds stop on a write begun under an open read.

pic run takes only requests nobody is running. A second pic asking into a conversation in use is refused with its owner's pid. An edit that misses in a file another conversation changed says so and shows the file; a write to such a file is refused once.

New test/pic/shared.sh: two-process crash matrix, kill -9 beside a live pic, claim and admission races, stale-file results. No schema change. check-in: eae917e9e9 user: dmestas tags: shared-store