]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: init: do not try to shrink existing RLIMIT_NOFIlE
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Sep 2022 14:12:08 +0000 (16:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Oct 2022 06:38:47 +0000 (08:38 +0200)
commitc06557c23b0e4e932405fe3f0739c303ac90926e
tree822147c7347451e742390ee12800807ee8e5ff4e
parent922a907926d1cb02a8a10c7cdb9917755c934c84
MINOR: init: do not try to shrink existing RLIMIT_NOFIlE

As seen in issue #1866, some environments will not allow to change the
current FD limit, and actually we don't need to do it, we only do it as
a byproduct of adjusting the limit to the one that fits. Here we're
replacing calls to setrlimit() with calls to raise_rlim_nofile(), which
will avoid making the setrlimit() syscall in case the desired value is
lower than the current process' one.

This depends on previous commit "MINOR: fd: add a new function to only
raise RLIMIT_NOFILE" and may need to be backported to 2.6, possibly
earlier, depending on users' experience in such environments.
src/extcheck.c
src/haproxy.c