Skip to content

Commit 85ae156

Browse files
committed
Revert "Generate Stack Traces for http response with status code zero"
Does not help with the bug investigation. the http server is designed to panic when the http status code is `0`. This reverts commit 72792d5.
1 parent 62e8a1b commit 85ae156

File tree

1 file changed

+1
-12
lines changed
  • staging/src/k8s.io/apiserver/pkg/server/filters

1 file changed

+1
-12
lines changed

staging/src/k8s.io/apiserver/pkg/server/filters/wrap.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ import (
2525
"k8s.io/apiserver/pkg/server/httplog"
2626
)
2727

28-
func badHTTPResponse() httplog.StacktracePred {
29-
return func(status int) bool {
30-
// http status code should not be zero
31-
if status == 0 {
32-
klog.Errorf("Bad HTTP Response - status is zero")
33-
return true
34-
}
35-
return false
36-
}
37-
}
38-
3928
// WithPanicRecovery wraps an http Handler to recover and log panics.
4029
func WithPanicRecovery(handler http.Handler) http.Handler {
4130
return withPanicRecovery(handler, func(w http.ResponseWriter, req *http.Request, err interface{}) {
@@ -50,7 +39,7 @@ func withPanicRecovery(handler http.Handler, crashHandler func(http.ResponseWrit
5039
crashHandler(w, req, err)
5140
})
5241

53-
logger := httplog.NewLogged(req, &w).StacktraceWhen(badHTTPResponse())
42+
logger := httplog.NewLogged(req, &w)
5443
defer logger.Log()
5544

5645
// Dispatch to the internal handler

0 commit comments

Comments
 (0)