]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: poll: the I/O handler was called twice for polled I/Os
authorWilly Tarreau <w@1wt.eu>
Thu, 13 Dec 2012 23:17:03 +0000 (00:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Dec 2012 23:17:03 +0000 (00:17 +0100)
commit39ebef82aae86976fc5e1bc293bcb677a064d3ee
tree219400fc103e3420ce674243a77c6e629faa53b7
parentfb5470d14488442686ffbf260a06a47892919c5c
BUG/MINOR: poll: the I/O handler was called twice for polled I/Os

When a polled I/O event is detected, the event is added to the updates
list and the I/O handler is called. Upon return, if the event handler
did not experience an EAGAIN, the event remains in the updates list so
that it will be processed later. But if the event was already in the
spec list, its state is updated and it will be called again immediately
upon exit, by fd_process_spec_events(), so this creates unfairness
between speculative events and polled events.

So don't call the I/O handler upon I/O detection when the FD already is
in the spec list. The fd events are still updated so that the spec list
is up to date with the possible I/O change.
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c