All three http.Server instances in pkg/server/server.go — the connect server, the metrics server, and the UI server — are constructed with only Addr and Handler. No timeout fields have ever been set, so connections can sit idle or withhold request headers for as long as they like.
Proposal
- Set
ReadHeaderTimeout and IdleTimeout on all three servers.
- Pick an
IdleTimeout larger than the keep-alive timeout of any fronting proxy, so the proxy never reuses a connection the server is about to close.
- Deliberately do not set a blanket
WriteTimeout: the connect server has long streaming export responses (for example ExportAuditRecords), and a write deadline would cut them off.
ReadTimeout, if added at all, needs a value that accounts for large request bodies.
Came out of review discussion on #1818, which touched the connect server construction; the gap itself predates that PR.
All three
http.Serverinstances inpkg/server/server.go— the connect server, the metrics server, and the UI server — are constructed with onlyAddrandHandler. No timeout fields have ever been set, so connections can sit idle or withhold request headers for as long as they like.Proposal
ReadHeaderTimeoutandIdleTimeouton all three servers.IdleTimeoutlarger than the keep-alive timeout of any fronting proxy, so the proxy never reuses a connection the server is about to close.WriteTimeout: the connect server has long streaming export responses (for exampleExportAuditRecords), and a write deadline would cut them off.ReadTimeout, if added at all, needs a value that accounts for large request bodies.Came out of review discussion on #1818, which touched the connect server construction; the gap itself predates that PR.