Repository navigation
Conversation
Since Go 1.19 the runtime raises its own soft RLIMIT_NOFILE to one below the hard limit at start-up, so runtimetest reads that raised value and not the one the runtime configured: the soft RLIMIT_NOFILE check fails against every runtime whenever the configured soft limit is lower. Go restores the original limit in the processes it starts, so read the limits of a child from its /proc/self/limits instead; the other limits are left untouched by Go and are still read directly. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
dangowrt
marked this pull request as ready for review
October 20, 2026 19:07
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.
Since Go 1.19 the runtime raises its own soft
RLIMIT_NOFILEto one below the hard limit at start-up (syscall/rlimit.go), soruntimetestreads that raised value instead of the one the runtime configured, and the softRLIMIT_NOFILEcheck fails against every runtime whenever the configured soft limit is lower than the hard one (e.g.expected: 3000, actual: 3999with a hard limit of 4000).Go restores the original limit in the processes it starts, so this reads
RLIMIT_NOFILEfrom/proc/self/limitsof a/bin/catchild; the other limits are untouched by Go and are still read directly. The parser has unit tests, and a test checks that a child's hard limit matches ours and its soft limit does not exceed ours.