Create files without O_NONBLOCK flag#8161
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8161 +/- ##
=======================================
Coverage 83.0% 83.0%
=======================================
Files 826 826
Lines 362561 362561
=======================================
Hits 301086 301086
Misses 61475 61475 🚀 New features to boost your workflow:
|
alessandrod
approved these changes
Sep 24, 2025
|
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
mergify Bot
pushed a commit
that referenced
this pull request
Sep 24, 2025
(cherry picked from commit 5d2df04)
kskalski
added a commit
that referenced
this pull request
Sep 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
We do not currently perform writes with
ASYNCflag, so they are first considered in non-blocking context (directly in the requesting thread, not in a worker) and re-submitted in the worker when they cannot be serviced immediately.On older kernels (5.15) such re-submission is however broken in the case of file being open with
O_NONBLOCKmode, but request needing to be done in blocking fashion (e.g. on a file-system not supporting non-blocking execution natively).In other words when IO needs to block, but it is submitted on a file required to not block, kernel just returns error, requiring the user to submit IO to the kernel worker, i.e. with
ASYNCflag (on newer kernel this path is handled automatically). See also discussion in #8053 (comment)Also,
O_NONBLOCKflag withoutO_DIRECTis actually an unusual / not supported mode, with io_uring we shouldn't use it at all.Summary of Changes
Don't create files in non-blocking mode, which relieves constraints on how IO is executed by the kernel and prevents
EAGAINerrors to be surfaced in io_uring completions on older kernels.Performance is not affected (leaning positive, but that is within noise):
Fixes #8036