]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: epoll: correctly disable FD polling in fd_rem()
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 19:54:41 +0000 (21:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 20:26:09 +0000 (22:26 +0200)
commitf8cfa447c676849e1d1b007353d4ea2f7231e4a0
tree6e5e7102ca5f34bab64fc9a4ef8654580fe55f71
parent050536d582cedb28043249e37a5754d1bb0b1e96
BUG/MINOR: epoll: correctly disable FD polling in fd_rem()

When calling fd_rem(), the polling was not correctly disabled because the
->prev state was set to zero instead of the previous value. fd_rem() is
very rarely used, only just before closing a socket.

The effect is that upon an error reported at the connection level, if the
task assigned to the connection was too slow to be woken up because of too
many other tasks in the run queue, the FD was still not disabled and caused
the connection handler to be called again with the same event until the task
was finally executed to close the fd.

This issue only affects the epoll poller, not the sepoll variant nor any of
the other ones.

It was already present in 1.4 and even 1.3 with the same almost unnoticeable
effects. The bug can in fact only be discovered during development where it
emphasizes other bugs.

It should be backported anyway.
src/ev_epoll.c