mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 10:10:06 +00:00
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.