Skip to content

Commit e59610a

Browse files
rockoragermitchellh
authored andcommitted
io_uring: handle INTR error from write
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. Automatically rearm the completion when the result is EINTR.
1 parent dbe2291 commit e59610a

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)