BUG/MEDIUM: threads/fd: do not forget to take into account epoll_fd/pipes
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Mar 2019 18:10:55 +0000 (19:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Mar 2019 19:02:37 +0000 (20:02 +0100)
commit2c58b41c96e70f567d0f9ae876a80770630c06ee
treee56c803e10bb21656a086024ab776082495d48aa
parent1d7f37a2cb395323605e474c1539836e609734b0
BUG/MEDIUM: threads/fd: do not forget to take into account epoll_fd/pipes

Each thread uses one epoll_fd or kqueue_fd, and a pipe (thus two FDs).
These ones have to be accounted for in the maxsock calculation, otherwise
we can reach maxsock before maxconn. This is difficult to observe but it
in fact happens when a server connects back to the frontend and has checks
enabled : the check uses its FD and serves to fill the loop. In this case
all FDs planed for the datapath are used for this.

This needs to be backported to 1.9 and 1.8.
src/haproxy.c