diff options
Diffstat (limited to 'src/fs.zig')
| -rw-r--r-- | src/fs.zig | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -338,6 +338,10 @@ pub fn Server(comptime Backend: type, comptime opts: Options) type { return struct { const Self = @This(); + /// A request past the parking cap (`slot_capacity`) says so in + /// words, and names the cap, rather than a C library's EAGAIN. + pub const e_waiting = std.fmt.comptimePrint("too many reads waiting: {d}", .{opts.slot_capacity}); + protocol: Protocol, root: u64, @@ -1455,7 +1459,7 @@ pub fn Server(comptime Backend: type, comptime opts: Options) type { return; } const i = s.freeSlot() orelse { - s.fail(j.tag, e_again); + s.fail(j.tag, e_waiting); s.finishJob(); return; }; @@ -2264,7 +2268,8 @@ test "fs server: a blocked read parks, and the connection keeps working" { } try h.send(200, .{ .tread = .{ .fid = 1, .offset = 0, .count = 4096 } }); got = try h.reap(); - try testing.expectEqualStrings(e_again, got.msg.rerror.ename); + try testing.expectEqualStrings(Srv.e_waiting, got.msg.rerror.ename); + try testing.expect(std.mem.startsWith(u8, Srv.e_waiting, "too many reads waiting: ")); } test "fs server: a parked open, truncate and clunk complete on retry, and a walk cannot park" { |
