proxy/service_health: release read lock early

Signed-off-by: Daman Arora <aroradaman@gmail.com>
This commit is contained in:
Daman Arora 2023-05-12 15:04:04 +05:30
parent ac7e5cbf69
commit 3dc4eea889

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")