Description
When limits.max_connections
is set, Fleet-Server will abruptly close connections, which makes the clients (usually Elastic-Agent) to get a read: connection reset by peer
. This is not helpful and does not enable the client to correctly adapt its behaviour.
The problem comes from the limitListener
(L 69):
fleet-server/internal/pkg/limit/listener.go
Lines 55 to 80 in 8ff01e3
If there is a proxy in front of Fleet-Server this can cause a very hard situation to debug from the client's (e.g: Elastic-Agent) perspective: Fleet Server gets a connection that is over the limit, closes the connection, which results in an EOF for the proxy, which translates it into a 502, which the elastic-agent enrol command swallows and does not display.