Skip to content

Set ReadHeaderTimeout and IdleTimeout on the HTTP servers #1819

Description

@AmanGIT07

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions