]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUG] stream_sock: cleanly disable the listener in case of resource shortage
authorWilly Tarreau <w@1wt.eu>
Tue, 21 Sep 2010 19:14:29 +0000 (21:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Sep 2010 19:14:29 +0000 (21:14 +0200)
commite9f32dbf5ce28396bcab9c954bf3180f75b0ff53
treed6d83770a92fbfebffff94468bd53524d9c651c5
parent5417081c798b3356c200cdd5f5daac6b8f666c12
[BUG] stream_sock: cleanly disable the listener in case of resource shortage

Jozsef R.Nagy reported a reliability issue on FreeBSD. Sometimes an error
would be emitted, reporting the inability to switch a socket to non-blocking
mode and the listener would definitely not accept anything. Cyril Bonté
narrowed this bug down to the call to EV_FD_CLR(l->fd, DIR_RD).

He was right because this call is wrong. It only disables input events on
the listening socket, without setting the listener to the LI_LISTEN state,
so any subsequent call to enable_listener() from maintain_proxies() is
ignored ! The correct fix consists in calling disable_listener() instead.

It is discutable whether we should keep such error path or just ignore the
event. The goal in earlier versions was to temporarily disable new activity
in order to let the system recover while releasing resources.
src/stream_sock.c