Skip to content

Commit b8d1d93

Browse files
authored
io_uring: handle INTR error from write (#119)
It is possible to get an EINTR error from io_uring when copying cqes. xev already handles EINTR automatically when it occurs during io_uring_enter, but doesn't handle it if an individual cqe copy has this error. Add error.SignalInterrupt to the WriteError enum so that callers may rearm their writes when encountering this error, if they desire.
2 parents dbe2291 + e59610a commit b8d1d93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/io_uring.zig

+2
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,8 @@ pub const Completion = struct {
744744
@intCast(res)
745745
else switch (@as(posix.E, @enumFromInt(-res))) {
746746
.CANCELED => error.Canceled,
747+
// If a write is interrupted, we retry it automatically.
748+
.INTR => return .rearm,
747749
else => |errno| posix.unexpectedErrno(errno),
748750
},
749751
},

0 commit comments

Comments
 (0)