Merge pull request #117969 from daman1807/fix/proxy-health-check

Release read lock early in proxy service health check
This commit is contained in:
Kubernetes Prow Robot 2023-05-12 06:03:09 -07:00 committed by GitHub
commit c056c36e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,8 +235,8 @@ func (h hcHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
return return
} }
count := svc.endpoints count := svc.endpoints
kubeProxyHealthy := h.hcs.healthzServer.IsHealthy()
h.hcs.lock.RUnlock() h.hcs.lock.RUnlock()
kubeProxyHealthy := h.hcs.healthzServer.IsHealthy()
resp.Header().Set("Content-Type", "application/json") resp.Header().Set("Content-Type", "application/json")
resp.Header().Set("X-Content-Type-Options", "nosniff") resp.Header().Set("X-Content-Type-Options", "nosniff")