From 17f998e682a0f29ea9e01fb0bf9c347fd259df7c Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Mon, 12 Oct 2026 08:40:12 +0200 Subject: [PATCH] fix(server): keep idle connections longer than orca-proxy's pool (502s on prod) The server closed idle keep-alive connections after 60 s while orca-proxy keeps upstream connections pooled for up to 90 s. A request sent on a connection the server was just closing failed with "connection closed before message completed" and the proxy answered 502: 76 times on tenant-registry-prod /healthz between 2026-10-09 and 2026-10-12, without restarts. IdleTimeout is now 120 s, above the proxy's pool timeout. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB --- cmd/server/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 0f3c5dd..4e1a682 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -164,7 +164,10 @@ func main() { Handler: handler, ReadTimeout: 10 * time.Second, WriteTimeout: 30 * time.Second, - IdleTimeout: 60 * time.Second, + // Above orca-proxy's upstream pool idle timeout (90 s): with a shorter + // value the proxy reuses connections the server is closing and answers + // 502 "connection closed before message completed". + IdleTimeout: 120 * time.Second, } ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)