Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Are uring jobs expected to return EINTR? #1452

Answered by axboe
talex5 asked this question in Q&A
Discussion options

If two threads use uring to write to stdout at the same time (using different rings), the write operation sometimes completes with EINTR (-4). Is this expected?

I can understand io_uring_enter itself returning EINTR, but I'm not sure what I'm supposed to do when an asynchronous job fails this way. Should uring itself be handling this?

Would be good to have this documented somewhere either way.

Thanks!

(this was originally reported at ocaml-multicore/eio#788)

/cc @wildfield @patricoferris

You must be logged in to vote

You can probably eliminate this issue by using IORING_SETUP_DEFER_TASKRUN as I bet the -EINTR is coming from task_work being queued and signaled via signals.

Replies: 3 comments 1 reply

Comment options

You can probably eliminate this issue by using IORING_SETUP_DEFER_TASKRUN as I bet the -EINTR is coming from task_work being queued and signaled via signals.

You must be logged in to vote
1 reply
Comment options

axboe Sep 1, 2025
Maintainer

And yes, it might be possible to appropriately retry this condition. Let me ponder that a bit.

Answer selected by talex5
Comment options

Indeed, IORING_SETUP_DEFER_TASKRUN makes the problem go away.

You must be logged in to vote
0 replies
Comment options

Not an answer, but a follow-up question --- would IORING_OP_TIMEOUT requests potentially return -EINTR too? I don't think there is an equivalent syscall for those, so I can't really tell if it might return EINTR errors by inferring from the equivalent syscall manpage.

If in the future a syscall is added to io_uring and that syscall is documented as NOT erroring with EINTR, would the io_uring version also NOT return -EINTR? (I can't remember offhand if there is any syscall that doesn't have EINTR but maybe there is one I just don't know about).

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /