The effective layering of ResponseWriters is today, from outside to inside, httplog(timeout(audit(metrics(original)))). From 6e3fd91e1aa3259d7bd67e0a65693e346ade347d, calls to http.Error in the apiserver's root healthz handler use an unwrapped ResponseWriter -- effectively timeout(audit(metrics(original))) -- to avoid logging stack traces for those requests. From 0d50c969c587c8a6c16e0962118305ac652c5a6b, the same call to http.Error receives a completely-unwrapped ResponseWriter. This has the effect of bypassing not only the httplog wrapper, but also timeout, audit, and metrics. The timeout wrapper defends against the (disallowed) use of underyling ResponseWriter after the completion of its request's ServeHTTP call. Since that defensive behavior is being bypassed, it's possible for the root healthz handler to panic when health probes time out. Instead of continuing to use a wrapper-aware means of disabling stack traces, this commit adds a new function to httplog that allows customization of the stack trace logging predicate on a per-request basis. Kubernetes-commit: ff849fe8b688606d5173d5ee0213a96cffae23c0 |
||
|---|---|---|
| .. | ||
| doc.go | ||
| healthz.go | ||
| healthz_test.go | ||