mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-06 11:28:00 +00:00
[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.
This commit is contained in:
parent
5417081c79
commit
e9f32dbf5c
@ -1205,7 +1205,7 @@ int stream_sock_accept(int fd)
|
||||
if (unlikely(ret < 0)) {
|
||||
/* critical error encountered, generally a resource shortage */
|
||||
if (p) {
|
||||
EV_FD_CLR(fd, DIR_RD);
|
||||
disable_listener(l);
|
||||
p->state = PR_STIDLE;
|
||||
}
|
||||
jobs--;
|
||||
|
Loading…
Reference in New Issue
Block a user