diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-30 15:38:35 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-30 16:49:16 -0300 |
| commit | 020a7d24103a7c6f788db1091fd921d41d0df9e8 (patch) | |
| tree | 3ba9602a41c896cf54d8b11f9a89919baada589d /src/pardes.zig | |
| parent | 5af775e9817395af39792cc609b832394d4a4fb8 (diff) | |
| download | pardes-020a7d24103a7c6f788db1091fd921d41d0df9e8.tar.gz pardes-020a7d24103a7c6f788db1091fd921d41d0df9e8.zip | |
views: a view opened or closed settles in its own input: a unit taped outside a step (a leave's close_view, a join's open_view) ended with effects queued, which a replica's copy asserted on and a joiner's dump dropped
A client's leave is the session's closeView, whose sync sizes again a terminal the closed view sized (`sizes`) and queues its pty's resize; the session did it at its next pump, another unit. A replica that replayed the close was left with the effect queued between steps, and its next idle copy (Replica.ready, rollback.Copy.take's assert) aborted it: a client killed when another left (H10). A client joining at that boundary was dumped with the effect still queued, which a core loaded from a dump has none of (Replica.initDump), and diverged at the session's next pump (H6: "the core called poll_frame where the tape has a host (12)"). closeView and openView settle now, inside their own taped input, so every side does the same there; openView's covers what else was queued since the last pump (a 9P request's step).
Test (failing before at each of the two asserts): a client leaves, and one joins: what the leave queued is done in its unit, on every side, before the join's dump.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 36ce6bdb..5b37342e 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5669,6 +5669,11 @@ pub const Pardes = struct { pub fn openView(p: *Pardes) ?u8 { const taped = tape.enter(p, .open_view); defer tape.leave(p, taped); + // What was queued since the last pump (a leaving client's view + // closed, a 9P request's step) done first, as every client of the + // tape does it here: a join dumps the session next, and a core + // loaded from a dump has no queue (Replica.initDump). + p.settle(); p.needs_frame = true; return views.open(p); } @@ -5680,6 +5685,11 @@ pub const Pardes = struct { defer tape.leave(p, taped); views.close(p, k); p.sync(); + // What its sync queued (a terminal it sized, sized again) done here, + // in its own unit on every side: the session's next pump is another + // unit, and a replica takes a copy only of a core with nothing + // queued (rollback.Copy.take). + p.settle(); } /// Into view `k`, before the input its client sent. |
