summaryrefslogtreecommitdiff
path: root/core/edit_cmd.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 15:13:48 -0300
committerGabriel Schneider <[email protected]>2026-11-20 15:34:15 -0300
commitd720cf44d458e3986d371f4b8b768a97ba489c9c (patch)
treeeda8e569d8c85cb7265e5419c1479c7559802c04 /core/edit_cmd.zig
parentfb7e632248c599a70689cd0451392c8a890044ee (diff)
downloadpardes-d720cf44d458e3986d371f4b8b768a97ba489c9c.tar.gz
pardes-d720cf44d458e3986d371f4b8b768a97ba489c9c.zip
ninep: a retry of a held Edit write is answered by the listener from its hold, no step: serveFsInner's first lines read fs.edit_hold, which the session's listener sets between steps (9p_io), so a retried write was the session's step that answered it and every replica's step that ran the Edit again (the tape's divergence, and a client's second pipe); the check is EditHold.retried, which the listener calls before serveFs, and the step never reads the hold (fs.edit_hold stays the listener's, as the namespace's doc now says); test "a client runs an Edit a script's write started once, as its session does, when the held write is asked again" (core/replica.zig, a client joined, the write held as the listener holds it, its command answered, the retry as the listener serves it): diverged on the base ("the core called clock where the tape has a done (0), in serve_fs"), passes now; edit_cmd's held-write test retries through EditHold.retried; a user could hit it: a script's Edit with a | < or > command whose write's park is retried (a 9P client's retry while the command runs) under a far or window client: the client diverged and joined again
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/edit_cmd.zig')
-rw-r--r--core/edit_cmd.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/edit_cmd.zig b/core/edit_cmd.zig
index 9a5c6865..ab4f2b5d 100644
--- a/core/edit_cmd.zig
+++ b/core/edit_cmd.zig
@@ -533,11 +533,11 @@ test "the held write asked again is parked again, then answered once, and a flus
// As 9p_io holds it.
p.fs.edit_hold = .{ .asker = @ptrCast(p), .slot = 0, .seq = 1, .tag = 7, .node = ctl, .handle = 0, .written = @intCast(req.data.len) };
// A retry of its park: still waiting, never run a second time.
- try testing.expectEqual(tree.Status.again, p.serveFs(req).status);
+ try testing.expectEqual(tree.Status.again, filesystem.EditHold.retried(&p.fs, req).?.status);
try testing.expect(p.pipe.edit_run != null);
answer(p, &.{"a\nb\n"});
try testing.expect(p.fs.edit_hold.?.done);
- const done = p.serveFs(req);
+ const done = filesystem.EditHold.retried(&p.fs, req).?;
try testing.expectEqual(tree.Status.ok, done.status);
try testing.expectEqual(@as(u32, @intCast(req.data.len)), done.written);
try testing.expect(p.fs.edit_hold == null);