diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-14 02:24:40 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-14 10:04:56 +0300 |
| commit | 0197e6e96ea391d6b44e9440f2add84a5dc70645 (patch) | |
| tree | f6096394bebfd657d88d3274ba1b1d29c6c69b74 /tests | |
| parent | 555ad5446199c9bd5258466f75e235d3efecbb84 (diff) | |
| download | accel-ppp-0197e6e96ea391d6b44e9440f2add84a5dc70645.tar.gz accel-ppp-0197e6e96ea391d6b44e9440f2add84a5dc70645.zip | |
metrics: back off accept loop on persistent errors
Previously the only path out of serv_read()'s accept loop was an
EAGAIN/EWOULDBLOCK return; every other failure logged once and fell
back into `continue`. With a level-readable listening fd, that means
EMFILE/ENFILE/ENOBUFS/ENOMEM pin the worker thread spinning on
accept() and saturate the log.
Detect that class of error and pause the listener: disable
MD_MODE_READ on serv_hnd, arm a one-shot triton timer for one
second, and on expiry re-enable the handler. EINTR and ECONNABORTED
are kept as transient retries — those are normal and short-lived.
Verified by running the daemon under `prlimit --nofile=24` and
opening enough slow connections to exhaust the limit. The first
accept failure logs
metrics: accept failed: Too many open files; backing off 1s
then the daemon idles at 0% CPU instead of spinning; once fds free
up it resumes accepting.
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions
