diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 16:19:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | d6445bb28bcb4a0d0e5f29c6308682737d253ebe (patch) | |
| tree | 22e4c50aa4f58643190e2aca1176b02ecd6f6c24 /src/9p_io.zig | |
| parent | eb47ded95f43e50dc24b841289b68814105dcfb7 (diff) | |
| download | pardes-d6445bb28bcb4a0d0e5f29c6308682737d253ebe.tar.gz pardes-d6445bb28bcb4a0d0e5f29c6308682737d253ebe.zip | |
A failure said while a 9P write waits on it posts no msg, only the write's err
A failure the editor said as it performed a write's work (a Save's disk write, a shell, a language server) was posted as a msg and taken back out when the write's err was logged, which it cannot be once a log follower has read it: a follower saw both. Such a failure is now posted without a msg in the first place (fs.write_waits), and nothing is taken back.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/9p_io.zig')
| -rw-r--r-- | src/9p_io.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig index 7f490f81..6f05e3ab 100644 --- a/src/9p_io.zig +++ b/src/9p_io.zig @@ -312,11 +312,14 @@ pub const Listener = struct { if (restoring) l.restore_writer.store(true, .release); defer if (restoring) l.restore_writer.store(false, .release); core.fs.late_failure_len = 0; + // What fails while this waits is this write's err, never a msg too. + core.fs.write_waits = true; if (core.effects_len != 0) pardes.turn.awaitSettled(epoch); if (core.fs.lsp_answer_at) |n| { core.fs.lsp_answer_at = null; pardes.turn.awaitLsp(n); } + core.fs.write_waits = false; // ponytail: one slot, so a failure of another client's effects that // settle in the same wait is told to this write too. if (l.core == core and core.fs.late_failure_len != 0) { @@ -327,9 +330,8 @@ pub const Listener = struct { pardes.ctlfs.E.NOENT else if (std.mem.indexOf(u8, late, "no space") != null) pardes.ctlfs.E.NOSPC else pardes.ctlfs.E.IO; const failed = pardes.ctlfs.failText(req.tag, errno, late); - // Its err record says it (the path in it); the msg the failure - // was also said as goes, as a builtin's failing a write does. - pardes.ctlfs.events.dropMessage(core, core.fs.late_failure[0..core.fs.late_failure_len]); + // Its err record says it (the path in it), the one record: it + // was said with no msg while this waited (fs.write_waits). pardes.ctlfs.events.noteError(core, req, failed); return conn.reply(&failed, ""); } |
