From ebcd22b02b9cd50d16850356d6b75012a7e1d3f6 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 20 Mar 2021 16:32:36 +0100 Subject: [PATCH] lib/osutil: Fix raising max FDs on macOS (#7507) There was a logic mistake, so the limit in question wasn't used. On my macOS this doesn't seem to matter, the hard limit returned is 2^63-1 and setting the soft limit to that works. However I'm assuming that's not the case for older macOSes since it was so nicely documented, so we should still have this working. (10240 FDs should be enough for anybody.) --- lib/osutil/rlimit_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/osutil/rlimit_unix.go b/lib/osutil/rlimit_unix.go index 91405d00c..5b95dc481 100644 --- a/lib/osutil/rlimit_unix.go +++ b/lib/osutil/rlimit_unix.go @@ -36,7 +36,7 @@ func MaximizeOpenFileLimit() (int, error) { // macOS doesn't like a soft limit greater then OPEN_MAX // See also: man setrlimit if runtime.GOOS == "darwin" && lim.Max > darwinOpenMax { - lim.Cur = darwinOpenMax + lim.Max = darwinOpenMax } // Try to increase the limit to the max.