Artifact dae7d8772e1d28e3367390c96c5beacda9362ab2ae32572586f9622c54711079:
- File
src/cmd/sync.zig
-
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: 206846) [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: 206846) [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