]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: polling: do not set speculative events on ERR nor HUP
authorWilly Tarreau <w@1wt.eu>
Thu, 6 Dec 2012 23:09:43 +0000 (00:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Dec 2012 23:09:43 +0000 (00:09 +0100)
commit26d7cfce328c33e208437b30b4ca3fc2db359cd2
treefd747b5229ecfbdfc402570e44cdd75b317ebe74
parentdebdc4b657056e517287f03f8439bb8e49be43ba
BUG/MAJOR: polling: do not set speculative events on ERR nor HUP

Errors and Hangups are sticky events, which means that once they're
detected, we never clear them, allowing them to be handled later if
needed.

Till now when an error was reported, it used to register a speculative
I/O event for both recv and send. Since the connection had not requested
such events, it was not able to detect a change and did not clear them,
so the events were called in loops until a timeout caused their owner
task to die.

So this patch does two things :
  - stop registering spec events when no I/O activity was requested,
    so that we don't end up with non-disablable polling state ;

  - keep the sticky polling flags (ERR and HUP) when leaving the
    connection handler so that an error notification doesn't
    magically become a normal recv() or send() report once the
    event is converted to a spec event.

It is normally not needed to make the connection handler emit an
error when it detects POLL_ERR because either a registered data
handler will have done it, or the event will be disabled by the
wake() callback.
src/connection.c
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c