When an idle connection is torn down by the beat, Error reading from connection: read tcp y.y.y.y:54668->x.x.x.x:443: use of closed network connection is logged by github.com/elastic/elastic-agent-libs/transport.(*loggingConn).Read"}
This appears to be called during the keep alive session maintenance every time data is read from the buffer? The last data in the buffer is the 200 OK from the server so we are receiving the full response.
When the connection is torn down, this receives an errNetClosing instead of an EOF (likely because we are the ones closing the connection and not the server. This code path only checks for EOF and thus we get the use of closed network connection err debug logged during the read.
This error message “pollutes” our debug logs and leads customers to believing there is a network issue.
When an idle connection is torn down by the beat,
Error reading from connection: read tcp y.y.y.y:54668->x.x.x.x:443: use of closed network connection
is logged bygithub.com/elastic/elastic-agent-libs/transport.(*loggingConn).Read"}
Here: https://github.com/elastic/elastic-agent-libs/blob/01275338dc278335b4a8c0f23055014b4c0702dc/transport/logging.go#L48-L54
This appears to be called during the keep alive session maintenance every time data is read from the buffer? The last data in the buffer is the 200 OK from the server so we are receiving the full response.
When the connection is torn down, this receives an errNetClosing instead of an EOF (likely because we are the ones closing the connection and not the server. This code path only checks for EOF and thus we get the
use of closed network connection
err debug logged during the read.This error message “pollutes” our debug logs and leads customers to believing there is a network issue.