Skip to content

Commit

Permalink
maxinflight handler should let panicrecovery handler call NewLogged
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamjvs committed Jul 12, 2017
1 parent 8e5584f commit 6ffbbad
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"k8s.io/apiserver/pkg/endpoints/metrics"
apirequest "k8s.io/apiserver/pkg/endpoints/request"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/server/httplog"

"github.com/golang/glog"
)
Expand Down Expand Up @@ -105,10 +104,6 @@ func WithMaxInFlightLimit(
}

func tooManyRequests(req *http.Request, w http.ResponseWriter) {
// "Too Many Requests" response is returned before logger is setup for the request.
// So we need to explicitly log it here.
defer httplog.NewLogged(req, &w).Log()

// Return a 429 status indicating "Too Many Requests"
w.Header().Set("Retry-After", retryAfter)
http.Error(w, "Too many requests, please try again later.", errors.StatusTooManyRequests)
Expand Down

0 comments on commit 6ffbbad

Please sign in to comment.