From: Jens Axboe <[email protected]>
To: Norman Maurer <[email protected]>,
io-uring <[email protected]>
Subject: Re: IORING_OP_RECVMSG not respects non-blocking nature of the fd
Date: Tue, 16 Mar 2021 08:23:11 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 3/16/21 8:00 AM, Norman Maurer wrote:
> Hi there,
>
> I think I found a bug in the current io_uring implementation. It seems
> like recvmsg currently not respect when a fd is set to non-blocking.
> At the moment recvmsg never returns in this case. I can work around
> this by using MSG_DONTWAIT but I don’t think this should be needed.
>
> I am using the latest 5.12 code base atm.
This is actually "by design" in that system calls that offer a "don't
block for this operation" (like MSG_DONTWAIT here) will not be looking
at the O_NONBLOCK flag. Though it is a bit confusing and potentially
inconsistent, my argument here is that this is the case for system calls
in general, where even O_NONBLOCK has very hazy semantics depending on
what system call you are looking at.
The issue is mostly around when to use -EAGAIN to arm async retry, and
when to return -EAGAIN to the application.
I'd like to hear from others here, but as far as io_uring is concerned,
we _should_ be consistent in how we treat O_NONBLOCK _depending_ on if
that system call allows a flags method of passing in nonblock behavior.
--
Jens Axboe
next prev parent reply other threads:[~2021-03-16 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 14:00 IORING_OP_RECVMSG not respects non-blocking nature of the fd Norman Maurer
2021-03-16 14:23 ` Jens Axboe [this message]
2021-03-16 16:00 ` Stefan Metzmacher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox