osrm-backend/src
Michael Bell f1a6056953 Immediately close bad connections to prevent file exhaustion
osrm-routed does not immediately clean up a keep-alive connection
when the client closes it. Instead it waits for five seconds
of inactivity before removing.

Given a setup with low file limits and clients opening and
closing a lot of keep-alive connections, it's possible for
osrm-routed to run out of file descriptors whilst it waits for
the clean-up to trigger.

Furthermore, this causes the connection acceptor loop to exit.
Even after the old connections are cleaned up, new ones
will not be created. Any new requests will block until the
server is restarted.

This commit improves the situation by:

- Immediately closing connections on error. This includes EOF errors
indicating that the client has closed the connection. This releases
resources early (including the open file) and doesn't wait for the
timer.

- Log when the acceptor loop exits. Whilst this means the behaviour
can still occur for reasons other than too many open files,
we will at least have visibility of the cause and can investigate further.
2021-09-04 01:55:36 +01:00
..
benchmarks Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
contractor Merge branch 'master' into avoid_samelookup_in_heap_map 2020-11-26 21:29:27 +01:00
customize Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
engine Avoid copying ManyToMany table results (#5923) 2021-01-04 08:46:51 -08:00
extractor Fix generation of inefficient MLD partitions 2021-09-03 22:48:10 +01:00
guidance Add support for multiple via-way restrictions (#5907) 2020-12-20 13:59:57 -08:00
nodejs Undo libosrm API break by adding old interface as method overload (#5861) 2021-01-27 09:14:44 -08:00
osrm Undo libosrm API break by adding old interface as method overload (#5861) 2021-01-27 09:14:44 -08:00
partitioner Fix generation of inefficient MLD partitions 2021-09-03 22:48:10 +01:00
server Immediately close bad connections to prevent file exhaustion 2021-09-04 01:55:36 +01:00
storage Remove redundant loading of .osrm.cell_metrics 2021-04-24 21:19:27 +01:00
tools Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
updater Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
util Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00