]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: init: restore behavior of command-line "-m" for memory limitation
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Jul 2021 10:31:08 +0000 (12:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 17 Jul 2021 10:31:08 +0000 (12:31 +0200)
The removal for the shared inter-process cache in commit 6fd0450b4
("CLEANUP: shctx: remove the different inter-process locking techniques")
accidentally removed the enforcement of rlimit_memmax_all which
corresponds to what is passed to the command-line "-m" argument.
Let's restore it.

Thanks to @nafets227 for spotting this. This fixes github issue #1319.

src/haproxy.c

index a4cbce5e33f29f76de99c58e0ec00d36a4c55629..d6aeed90678cffb4fee690d86fd5767b7f6155c3 100644 (file)
@@ -2014,6 +2014,9 @@ static void init(int argc, char **argv)
                exit(1);
        }
 
+       if (global.rlimit_memmax_all)
+               global.rlimit_memmax = global.rlimit_memmax_all;
+
 #ifdef USE_NS
         err_code |= netns_init();
         if (err_code & (ERR_ABORT|ERR_FATAL)) {