~emersion/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH tlstunnel] Remove file limit bump

Details
Message ID
<20240509005840.1509145-1-me@tomlebreux.com>
DKIM signature
pass
Download raw message
Patch: +0 -16
Starting with Go 1.19[0] the file limit is increased by default.

[0]: https://github.com/golang/go/commit/8427429c592588af8c49522c76b3e0e0e335d270
---
As discussed on the mailing list, we might as well just get rid of this
since upstream Go increases the limit by default at startup.
 cmd/tlstunnel/main.go | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/cmd/tlstunnel/main.go b/cmd/tlstunnel/main.go
index 1adcac317619..be113e062237 100644
--- a/cmd/tlstunnel/main.go
+++ b/cmd/tlstunnel/main.go
@@ -51,27 +51,11 @@ func newServer() (*tlstunnel.Server, error) {
	return srv, nil
}

func bumpOpenedFileLimit() error {
	var rlimit syscall.Rlimit
	if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlimit); err != nil {
		return fmt.Errorf("failed to get RLIMIT_NOFILE: %v", err)
	}
	rlimit.Cur = rlimit.Max
	if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlimit); err != nil {
		return fmt.Errorf("failed to set RLIMIT_NOFILE: %v", err)
	}
	return nil
}

func main() {
	flag.StringVar(&configPath, "config", configPath, "path to configuration file")
	flag.BoolVar(&debug, "debug", false, "enable debug logging")
	flag.Parse()

	if err := bumpOpenedFileLimit(); err != nil {
		log.Printf("failed to bump max number of opened files: %v", err)
	}

	srv, err := newServer()
	if err != nil {
		log.Fatalf("failed to create server: %v", err)
-- 
2.44.0

[tlstunnel/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D14PGFSUUJOX.1Q0X2FLSQ1SSV@fra01>
In-Reply-To
<20240509005840.1509145-1-me@tomlebreux.com> (view parent)
DKIM signature
missing
Download raw message
tlstunnel/patches/.build.yml: SUCCESS in 38s

[Remove file limit bump][0] from [Tom Lebreux][1]

[0]: https://lists.sr.ht/~emersion/public-inbox/patches/51726
[1]: me@tomlebreux.com

✓ #1216241 SUCCESS tlstunnel/patches/.build.yml https://builds.sr.ht/~emersion/job/1216241
Details
Message ID
<AHe6PwKx2i61R9dUYpu13nyqZIY_V7Y6wuypICsNCGdTlxp1JWZiWeyhLihVFnlN00lCCie7_ufCY8ZROEWKpKjuYCLug4gnURB0JORSV70=@emersion.fr>
In-Reply-To
<20240509005840.1509145-1-me@tomlebreux.com> (view parent)
DKIM signature
pass
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)