Mercurial > hg > nginx
comparison src/os/unix/ngx_errno.h @ 4618:c05cfc46b3bc
Accept moderation in case of EMFILE/ENFILE.
In case of EMFILE/ENFILE returned from accept() we disable accept events,
and (in case of no accept mutex used) arm timer to re-enable them later.
With accept mutex we just drop it, and rely on normal accept mutex handling
to re-enable accept events once it's acquired again.
As we now handle errors in question, logging level was changed to "crit"
(instead of "alert" used for unknown errors).
Note: the code might call ngx_enable_accept_events() multiple times if
there are many listen sockets. The ngx_enable_accept_events() function was
modified to check if connection is already active (via c->read->active) and
skip it then, thus making multiple calls safe.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 11 May 2012 13:33:06 +0000 |
parents | 0b05acc045eb |
children | f1a0de6eb505 |
comparison
equal
deleted
inserted
replaced
4617:972642646f06 | 4618:c05cfc46b3bc |
---|---|
27 #define NGX_EEXIST EEXIST | 27 #define NGX_EEXIST EEXIST |
28 #define NGX_EXDEV EXDEV | 28 #define NGX_EXDEV EXDEV |
29 #define NGX_ENOTDIR ENOTDIR | 29 #define NGX_ENOTDIR ENOTDIR |
30 #define NGX_EISDIR EISDIR | 30 #define NGX_EISDIR EISDIR |
31 #define NGX_EINVAL EINVAL | 31 #define NGX_EINVAL EINVAL |
32 #define NGX_ENFILE ENFILE | |
33 #define NGX_EMFILE EMFILE | |
32 #define NGX_ENOSPC ENOSPC | 34 #define NGX_ENOSPC ENOSPC |
33 #define NGX_EPIPE EPIPE | 35 #define NGX_EPIPE EPIPE |
34 #define NGX_EINPROGRESS EINPROGRESS | 36 #define NGX_EINPROGRESS EINPROGRESS |
35 #define NGX_EADDRINUSE EADDRINUSE | 37 #define NGX_EADDRINUSE EADDRINUSE |
36 #define NGX_ECONNABORTED ECONNABORTED | 38 #define NGX_ECONNABORTED ECONNABORTED |