From 087dc13965076ffca70170e241a2e209df31fe75 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 22 Oct 2021 01:30:27 -0700 Subject: [PATCH] fix: server in shutdown should return 503 instead of 403 (#13496) various situations where the client is retrying the request server going through shutdown might incorrectly send 403 which is a non-retriable error, this PR allows for clients when they retry an attempt to go to another healthy pod or server in a distributed cluster - assuming it is a properly load-balanced setup. --- internal/http/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/http/server.go b/internal/http/server.go index b9bd04f36..1315031ea 100644 --- a/internal/http/server.go +++ b/internal/http/server.go @@ -90,7 +90,7 @@ func (srv *Server) Start(ctx context.Context) (err error) { if atomic.LoadUint32(&srv.inShutdown) != 0 { // To indicate disable keep-alives w.Header().Set("Connection", "close") - w.WriteHeader(http.StatusForbidden) + w.WriteHeader(http.StatusServiceUnavailable) w.Write([]byte(http.ErrServerClosed.Error())) w.(http.Flusher).Flush() return