bind9/lib/ns
Ondřej Surý e31190e704
Reset the TCP connection on a failed send
When sending fails, the ns__client_request() would not reset the
connection and continue as nothing is happening.  This comes from the
model that we don't care about failed UDP sends because datagrams are
unreliable anyway, but it greatly affects TCP connections with
keep-alive.

The worst case scenario is as follows:

1. the 3-way TCP handshake gets completed
2. the libuv calls the "uv_connection_cb" callback
3. the TCP connection gets queue because of the tcp-clients quota
4. the TCP client sends as many DNS messages as the buffers allow
5. the TCP connection gets dropped by the client due to the timeout
6. the TCP connection gets accepted by the server
7. the data already sent by the client gets read
8. all sending fails immediately because the TCP connection is dead
9. we consume all the data in the buffer in a very tight loop

As it doesn't make sense to trying to process more data on the TCP
connection when the sending is failing, drop the connection immediately
on the first sending error.

(cherry picked from commit bf9fd2a6ff)
2024-07-03 09:10:30 +02:00
..
include Remove the extra memory context with own arena for sending 2024-06-10 18:43:46 +02:00
client.c Reset the TCP connection on a failed send 2024-07-03 09:10:30 +02:00
hooks.c Update sources to Clang 15 formatting 2022-11-29 09:14:07 +01:00
interfacemgr.c Fix flawed logic when detecting same listener type 2024-01-15 14:31:06 +02:00
listenlist.c remove nonfunctional DSCP implementation 2023-01-09 14:23:26 -08:00
log.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
Makefile.am Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
notify.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
query.c Clear qctx->zversion 2024-06-10 19:20:06 +02:00
server.c Allocate DNS send buffers using dedicated per-worker memory arenas 2023-09-05 15:02:30 +02:00
sortlist.c De-duplicate __FILE__, __LINE__ 2022-10-17 16:00:26 +01:00
stats.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
tests Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
update.c Log error when update fails 2024-06-10 18:51:28 +02:00
xfrout.c Adjust comment to have correct message limit value 2023-11-16 12:22:08 +11:00