From 62a3f33f0bac482121366cdc44f36b22adebf390 Mon Sep 17 00:00:00 2001 From: Roman Zavodskikh Date: Fri, 26 Apr 2024 18:06:32 +0200 Subject: [PATCH] Create a minimum failure ratio for enabling PHC It is hardcoded to 5% now, but we plan to make it configurable. Signed-off-by: Roman Zavodskikh --- proxy/healthy_endpoints.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/healthy_endpoints.go b/proxy/healthy_endpoints.go index 8e172993bd..fbdfcbd773 100644 --- a/proxy/healthy_endpoints.go +++ b/proxy/healthy_endpoints.go @@ -22,7 +22,7 @@ func (h *healthyEndpoints) filterHealthyEndpoints(ctx *context, endpoints []rout filtered := make([]routing.LBEndpoint, 0, len(endpoints)) for _, e := range endpoints { dropProbability := e.Metrics.HealthCheckDropProbability() - if p < dropProbability { + if dropProbability > 0.05 && p < dropProbability { ctx.Logger().Infof("Dropping endpoint %q due to passive health check: p=%0.2f, dropProbability=%0.2f", e.Host, p, dropProbability) metrics.IncCounter("passive-health-check.endpoints.dropped")