mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-10 07:49:54 +00:00
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).
This commit is contained in:
parent
8b8fd56ca5
commit
cf181c9d40
@ -133,9 +133,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
|
||||
|
||||
/* now let's wait for polled events */
|
||||
|
||||
fd = MIN(maxfd, global.tune.maxpollevents);
|
||||
gettimeofday(&before_poll, NULL);
|
||||
status = epoll_wait(epoll_fd, epoll_events, fd, wait_time);
|
||||
status = epoll_wait(epoll_fd, epoll_events, global.tune.maxpollevents, wait_time);
|
||||
tv_update_date(wait_time, status);
|
||||
measure_idle();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user