MINOR: fd: report an error message when failing initial allocations
authorWilly Tarreau <w@1wt.eu>
Tue, 13 Oct 2020 13:45:07 +0000 (15:45 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 19 Oct 2020 06:41:24 +0000 (08:41 +0200)
commita0eeba891310ce85f2f348dd42c0fafec2e0e511
tree25a88e7063a49facd4153dad1cefb16bbb02235e
parent70b0527f294939a21bf9819b941bf6a05a5db9c9
MINOR: fd: report an error message when failing initial allocations

When starting with a huge maxconn (say 1 billion), the only error seen
is "No polling mechanism available". This doesn't help at all to resolve
the problem. Let's add specific alerts for the failed mallocs. Now we can
get this instead:

  [ALERT] 286/154439 (23408) : Not enough memory to allocate 2000000033 entries for fdtab!

This may be backported as far as 2.0 as it helps debugging bad configurations.

(cherry picked from commit 7c9f756dcc51b9974d5e81116e1d8a34a6152040)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 2e0c88d6418bd90877a30ef5db414fe412f5a1b6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/fd.c