Skip to content

mainloop: fix stuck when io_uring is enabled#4304

Merged
stgraber merged 4 commits intolxc:masterfrom
mihalicyn:io_uring_stuck_fix
Apr 21, 2023
Merged

mainloop: fix stuck when io_uring is enabled#4304
stgraber merged 4 commits intolxc:masterfrom
mihalicyn:io_uring_stuck_fix

Conversation

@mihalicyn
Copy link
Member

Something is wrong with multishot polling mode in io_uring. Let's workaround that and safe from possible stucks on read.

Currently, fd_make_nonblocking does exactly the opposite thing,
it clears O_NONBLOCK flag and makes fd blocking.

Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Let's prevent freezes on read(2) by making a terminal FDs non-blocking.

It was discovered that there is an issue with io_uring mainloop when
multishot poll (IORING_POLL_ADD_MULTI) mode is enabled. Sometimes
false-positive poll events are put into a CQ. It makes further read(2)
stuck forever and blocks all mainloop processing for an infinite time.

Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Let's disable IORING_POLL_ADD_MULTI to workaround an issue
with false-positive POLLIN events in CQ.

In my local setup I managed to fix an issue without this
by making terminal FDs non-blocking, but during full
testsuite execution in Jenkins it was found that issue
still persists. So, let's add this ugly workaround too.

Signed-off-by: Alexander Mikhalitsyn <[email protected]>
@lxc-jenkins
Copy link

Testsuite passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants