osrm-backend/include
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
..
contractor Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
customizer Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
engine Reduce copying in API parameter constructors 2021-01-06 23:15:35 +00:00
extractor Increase PackedOSMIDs size to 34 bits 2021-04-24 23:41:02 +01:00
guidance Add support for multiple via-way restrictions (#5907) 2020-12-20 13:59:57 -08:00
nodejs Validate source/destination indices correctly in nodejs support (#5595) 2021-01-28 06:02:01 -08:00
osrm Undo libosrm API break by adding old interface as method overload (#5861) 2021-01-27 09:14:44 -08:00
partitioner Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
server Immediately close bad connections to prevent file exhaustion 2021-09-04 01:55:36 +01:00
storage 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 Add support for multiple via-way restrictions (#5907) 2020-12-20 13:59:57 -08:00