]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: epoll: use a fix maxevents argument in epoll_wait()
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Jan 2013 14:22:41 +0000 (15:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Jan 2013 14:31:03 +0000 (15:31 +0100)
commitcf181c9d404815f890da7cd2243a5528edd7b4f9
tree59e0cf71b81c80932c53ee9b0145c65edb3fd551
parent8b8fd56ca56d20931928154ea18f62a5198fb490
BUG/MINOR: epoll: use a fix maxevents argument in epoll_wait()

epoll_wait() takes a number of returned events, not the number of
fds to consider. We must not pass it the number of the smallest fd,
as it leads to value zero being used, which is invalid in epoll_wait().
The effect may sometimes be observed with peers sections trying to
connect and causing 2-seconds CPU loops upon a soft reload because
epoll_wait() immediately returns -1 EINVAL instead of waiting for the
timeout to happen.

This fix should be backported to 1.4 too (into ev_epoll and ev_sepoll).
src/ev_epoll.c