Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: automatically bump RLIMIT_NOFILE on Unix [1.20 backport] #59064

Closed
gopherbot opened this issue Mar 15, 2023 · 3 comments
Closed

runtime: automatically bump RLIMIT_NOFILE on Unix [1.20 backport] #59064

gopherbot opened this issue Mar 15, 2023 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@ianlancetaylor requested issue #46279 to be considered for backport to the next 1.20 minor release.

@gopherbot Please open backport issues.

CL 393354, which first appeared in Go one point nineteen, causes Go programs that start other non-Go programs to lose the soft NOFILES rlimit. This breaks programs that care about that. CLs 476096 and 476097 fix the problem by changing the syscall fork and exec functions to restore the original soft rlimit if appropriate. This is a request to backport those changes to the currently supported releases.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Mar 15, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Mar 15, 2023
@gopherbot gopherbot added this to the Go1.20.3 milestone Mar 15, 2023
@heschi heschi added the CherryPickApproved Used during the release process for point releases label Mar 22, 2023
@heschi
Copy link
Contributor

heschi commented Mar 22, 2023

Fix CL seems largeish but harmless; as long as the backport CLs aren't more complicated, approved.

@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Mar 22, 2023
@gopherbot
Copy link
Author

Change https://go.dev/cl/478659 mentions this issue: [release-branch.go1.20] syscall: restore original NOFILE rlimit in child process

paralin added a commit to skiffos/buildroot that referenced this issue Mar 29, 2023
paralin added a commit to skiffos/buildroot that referenced this issue Mar 31, 2023
@mknyszek mknyszek modified the milestones: Go1.20.3, Go1.20.4 Apr 4, 2023
paralin added a commit to skiffos/buildroot that referenced this issue Apr 4, 2023
paralin added a commit to skiffos/buildroot that referenced this issue Apr 6, 2023
gopherbot pushed a commit that referenced this issue Apr 14, 2023
…ild process

If we increased the NOFILE rlimit when starting the program,
restore the original rlimit when forking a child process.

In CL 393354 the os package was changed to raise the open file rlimit
at program start. That code is not inherently tied to the os package.
This CL moves it into the syscall package.

This is a backport of CLs 476096 and 476097 from trunk.

For #46279
Fixes #59064

Change-Id: Ib813de896de0a5d28fa2b29afdf414a89fbe7b2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/478659
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
@gopherbot
Copy link
Author

Closed by merging ecf7e00 to release-branch.go1.20.

paralin added a commit to skiffos/buildroot that referenced this issue Apr 22, 2023
paralin added a commit to skiffos/buildroot that referenced this issue Apr 28, 2023
paralin added a commit to skiffos/buildroot that referenced this issue May 1, 2023
paralin added a commit to skiffos/buildroot that referenced this issue May 2, 2023
paralin added a commit to skiffos/buildroot that referenced this issue May 2, 2023
bradfitz pushed a commit to tailscale/go that referenced this issue May 25, 2023
…ild process

If we increased the NOFILE rlimit when starting the program,
restore the original rlimit when forking a child process.

In CL 393354 the os package was changed to raise the open file rlimit
at program start. That code is not inherently tied to the os package.
This CL moves it into the syscall package.

This is a backport of CLs 476096 and 476097 from trunk.

For golang#46279
Fixes golang#59064

Change-Id: Ib813de896de0a5d28fa2b29afdf414a89fbe7b2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/478659
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
bradfitz pushed a commit to tailscale/go that referenced this issue May 25, 2023
…ild process

If we increased the NOFILE rlimit when starting the program,
restore the original rlimit when forking a child process.

In CL 393354 the os package was changed to raise the open file rlimit
at program start. That code is not inherently tied to the os package.
This CL moves it into the syscall package.

This is a backport of CLs 476096 and 476097 from trunk.

For golang#46279
Fixes golang#59064

Change-Id: Ib813de896de0a5d28fa2b29afdf414a89fbe7b2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/478659
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
@golang golang locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants