From 9bc1a5e405e8d219047cff52df83ebf5ec48974d Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Tue, 16 Jul 2024 17:29:44 +0200 Subject: [PATCH] Don't set `server#WriteTimeout` Setting `10s` as a write timeout might not cause any problems when the request is processed successfully, but when we e.g. have to retry any database errors, which is `5m` by default, this will just in an i/o timeout and the listener won't event write any hints about that, but will silently abort the connections. --- internal/listener/listener.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/listener/listener.go b/internal/listener/listener.go index c7d26ae68..785060b45 100644 --- a/internal/listener/listener.go +++ b/internal/listener/listener.go @@ -55,11 +55,10 @@ func (l *Listener) Run(ctx context.Context) error { listenAddr := daemon.Config().Listen l.logger.Infof("Starting listener on http://%s", listenAddr) server := &http.Server{ - Addr: listenAddr, - Handler: l, - ReadTimeout: 10 * time.Second, - WriteTimeout: 10 * time.Second, - IdleTimeout: 30 * time.Second, + Addr: listenAddr, + Handler: l, + ReadTimeout: 10 * time.Second, + IdleTimeout: 30 * time.Second, } serverErr := make(chan error)