Artifact d022ae54fa4518fede5d85727b4f624e6e08d98a4378684fc93aca4c6d5cdbbb:
- File
src/repostate.zig
-
2026-07-23 13:06:06
— part of check-in
[e2e9233582]
on branch fix9-serve-stall
— Serve: bound a sync round by the request, not by the store
Two costs made a clone of a large repository O(rounds x store) of work; past a few thousand artifacts a round outran the connection deadline and the server answered nothing at all.
The reply's advertise walk classified every rid by calling content(), which INFLATES a wire-backed entry, so announcing the store cost its uncompressed size every round. It now reads held(), answering from the retained form alone. The send gate still reads content(): uploading composes from plaintext.
ServeCtx caches the snapshot and rebuilds only when a stat shows the log grew, so a commit made alongside a live server is still advertised next request. That rebuild is O(store) and stays out of every client's budget: serve primes before it listens, and a round that appends rebuilds before returning. Reuse needs isolation, since the responder interns phantoms as it answers, so a new OverlayStore gives each round a write overlay.
Inflating memoises, so a snapshot outliving its round accumulates the whole repository's plaintext. It is released per round. Four clones of 3001 artifacts, ReleaseFast: 12 MB and 0.09 s, against 26 MB and 0.15 s. (user: dmestas, size: 183148) [annotate] [blame] [check-ins using]
-
2026-07-23 14:58:35
— part of check-in
[6763d35da7]
on branch trunk
— Merge fix9-serve-stall: bound a sync round by the request, not by the store
Two costs made a clone of a large repository O(rounds x store) of work; past a few thousand artifacts a round outran the connection deadline and the server answered nothing at all.
The reply's advertise walk classified every rid by calling content(), which INFLATES a wire-backed entry, so announcing the store cost its uncompressed size every round. It now reads held(), answering from the retained form alone. The send gate still reads content(): uploading composes from plaintext.
ServeCtx caches the snapshot and rebuilds only when a stat shows the log grew, so a commit made alongside a live server is still advertised next request. That rebuild is O(store) and stays out of every client's budget: serve primes before it listens, and a round that appends rebuilds before returning. Reuse needs isolation, since the responder interns phantoms as it answers, so a new OverlayStore gives each round a write overlay. Inflating memoises, so a snapshot outliving its round accumulates the whole repository's plaintext; it is released per round.
The one conflict, at the tail of src/cmd/sync.zig, was two independent test appends; resolved as the union. (user: dmestas, size: 183148) [annotate] [blame] [check-ins using]
-
2026-07-23 13:06:06
— part of check-in
[e2e9233582]
on branch fix9-serve-stall
— Serve: bound a sync round by the request, not by the store