diff --git a/pkg/http/handler/timeout.go b/pkg/http/handler/timeout.go index f864a07fb268..b41f240bf07b 100644 --- a/pkg/http/handler/timeout.go +++ b/pkg/http/handler/timeout.go @@ -127,9 +127,8 @@ func (h *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return case <-timeout.C(): timeoutDrained = true - if tw.tryTimeoutAndWriteError(h.body) { - return - } + tw.timeoutAndWriteError(h.body) + return case now := <-idleTimeoutCh: timedOut, timeToNextTimeout := tw.tryIdleTimeoutAndWriteError(now, revIdleTimeout, h.body) if timedOut {