Skip to content

Commit

Permalink
io_uring: handle INTR error from write
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rockorager authored and steeve committed Jan 17, 2025
1 parent 17a910a commit a69b75e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backend/io_uring.zig
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ pub const Completion = struct {
@intCast(res)
else switch (@as(posix.E, @enumFromInt(-res))) {
.CANCELED => error.Canceled,
// If a write is interrupted, we retry it automatically.
.INTR => return .rearm,
else => |errno| posix.unexpectedErrno(errno),
},
},
Expand Down

0 comments on commit a69b75e

Please sign in to comment.