From: Willy Tarreau Date: Sat, 17 Jul 2021 10:31:08 +0000 (+0200) Subject: BUG/MEDIUM: init: restore behavior of command-line "-m" for memory limitation X-Git-Tag: v2.5-dev2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79c9bdf63dc0e38a7ccfa608b962faf2bdbb3c73;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: init: restore behavior of command-line "-m" for memory limitation 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. --- diff --git a/src/haproxy.c b/src/haproxy.c index a4cbce5e33..d6aeed9067 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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)) {