unix: fix EMFILE busy loop
Don't spin in epoll_wait() / kevent() / port_getn() / etc. when we can't accept() a new connection due to having reached the file descriptor limit. Pass the error to the connection_cb and let the libuv user deal with it.
This commit is contained in:
parent
33bcb63596
commit
12c25e1027
@ -186,9 +186,6 @@ void uv__server_io(uv_loop_t* loop, uv__io_t* w, int events) {
|
|||||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||||
/* No problem. */
|
/* No problem. */
|
||||||
return;
|
return;
|
||||||
} else if (errno == EMFILE) {
|
|
||||||
/* TODO special trick. unlock reserved socket, accept, close. */
|
|
||||||
return;
|
|
||||||
} else if (errno == ECONNABORTED) {
|
} else if (errno == ECONNABORTED) {
|
||||||
/* ignore */
|
/* ignore */
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user