reactor: a ring the kernel refuses reaches OnFault instead of ending the process - #273
Merged
Merged
Conversation
…the process Ring.Create ran outside the try that hands faults to OnFault, so a host that set OnFault still lost the process when io_uring_setup failed - on a kernel older than 6.1, for one. It now has its own catch. The message names the cause instead of a bare errno: a kernel too old for SINGLE_ISSUER | DEFER_TASKRUN, too many entries, io_uring disabled by policy.
Merged
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.
Fixes #270
Ring.Createran outside thetrythat hands faults toOnFault("nothing to tear down until it returns"), so a host that setOnFaultstill lost the process whenio_uring_setupfailed - the WSL2 5.15 case in the issue. It now has its own catch:OnFaultgets the exception andRunreturns. A host withoutOnFaultstill gets it thrown out ofRun, asOnFaultdocuments.The message now names the cause instead of a bare errno:
io_uring_setup failed with errno 22 for a ring of 8192 entries on Linux 5.15.167.4-microsoft-standard-WSL2: the kernel does not know SINGLE_ISSUER | DEFER_TASKRUN, and ioxide needs Linux 6.1 or later....: the kernel allows at most 32768 (ServerConfig.RingEntries).kernel.io_uring_disabledsysctl or a seccomp profile (a container runtime's default). ENOSYS: built without io_uring. ENOMEM keeps its memlock advice.Tests
reactor: a ring the kernel refuses reaches OnFault instead of ending the process: 65536 entries is EINVAL on every kernel. On main it fails withthe refused ring was thrown out of Run past OnFault ... io_uring_setup failed with errno 22; passes here.ring setup: ...(Unit, 3): the message for an old kernel, for too many entries, and for EPERM.All suites pass: E2E 232, Unit 63, Chaos 47, Http 44, Tls 151 (the 7 kTLS tests skip without sudo), File 4. Startup only, so no bench.
Not done: a probe a host could call before starting any thread (the issue's other suggestion).
OnFaultalready reports the failure, so I left the API surface alone - say if GenHTTP wants one to fall back before spawning reactors.