summaryrefslogtreecommitdiff
path: root/runtime/9p_io.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 09:46:05 -0300
committerGabriel Schneider <[email protected]>2026-11-20 11:35:33 -0300
commit214839df238faa462de02274ef4322ea484cf383 (patch)
tree7c5dfcadddf6a30af697eb3ee9c4412d297832c0 /runtime/9p_io.zig
parentefbb9bb38b800deb47e581fd7b0a7ea06d504122 (diff)
downloadpardes-214839df238faa462de02274ef4322ea484cf383.tar.gz
pardes-214839df238faa462de02274ef4322ea484cf383.zip
ask: pardes - and a forwarded look wait for the session's answer untimed, a dead session being its connection's end: Client.ask (runtime/9p_io.zig) gave each request 2 s and the read of the answer 30 s after the last write, and a session putting 256 MiB of stdin into a +Pager on a loaded machine answered later than that (strace: the answer's poll timed out 30 s after the last write), so pardes - exited 1 with 'no +Pager pane: timed out; the text follows' and dumped the text to stderr while the session made the pane anyway (5 of 5 at a load of 38-48; the process-test flags case 3 of 3 whole runs earlier); untimed after the connect, as follow (--wait) is; after, pinned to one CPU: pager_rep 0 of 5, the flags case 0 of 5; the five together: tui core-test 859/1014, shell-test 1055/1058, pane-test 183/184, term-test 17/17, kitty-test 45/45, behaviour-test 275/275 and --replay, process-test 0 of 144 (cmdexit once, again alone), daemon.py in every mode, both soaks diverged 0 unequal 0, gui unit-test 1651/1655 (BaselineHarnessMismatch), the frame and perf gate against tree2 PASS
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime/9p_io.zig')
-rw-r--r--runtime/9p_io.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/9p_io.zig b/runtime/9p_io.zig
index bcb0f81b..aaca377d 100644
--- a/runtime/9p_io.zig
+++ b/runtime/9p_io.zig
@@ -1896,7 +1896,9 @@ pub const Client = struct {
/// same open, as /pane/new answers its own open: a session's last
/// answer, from another client, can never be what comes back. `exec
/// 3<>file`. `more` (`pardes -`'s text after its /pager line) goes in
- /// Twrites at rising offsets, each answer giving the next its budget.
+ /// Twrites at rising offsets. Untimed once connected: the answer comes
+ /// when the session's step has run, however long a loaded machine
+ /// takes over 256 MiB, and a session that died ends the connection.
pub fn ask(gpa: std.mem.Allocator, dial: []const u8, path: []const u8, request: []const u8, more: []const u8) ![]u8 {
if (comptime !supported) return error.Unsupported;
var names: [max_depth][]const u8 = undefined;
@@ -1905,6 +1907,7 @@ pub const Client = struct {
errdefer said = remote;
const s = try startSession(dial, path);
defer endSession(s, false);
+ s.deadline = std.math.maxInt(i64);
const fid = try walkTo(s, names[0..n], &remote);
_ = try s.ask(.{ .open = .{ .fid = fid, .mode = ninep.ordwr } }, &remote);
var written: usize = 0;
@@ -1914,7 +1917,6 @@ pub const Client = struct {
const count = (try s.ask(.{ .write = .{ .fid = fid, .offset = written, .data = chunk } }, &remote)).write;
if (count == 0 or count > chunk.len) return Error.Botch;
written += count;
- s.deadline = nowMs() +| write_budget_ms;
}
var out: std.ArrayList(u8) = .empty;
errdefer out.deinit(gpa);