Skip to content

Commit 2f67dc9

Browse files
yangligt2liu-cong
andauthored
Fix: Handle empty string healthcheck as readiness healthcheck (#1402)
* Fix: Handle empty string healthcheck as overall healthcheck * Apply suggestion from liu-cong Co-authored-by: Cong Liu <[email protected]> --------- Co-authored-by: Cong Liu <[email protected]>
1 parent dd6834a commit 2f67dc9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/epp/runner/health.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ func (s *healthServer) Check(ctx context.Context, in *healthPb.HealthCheckReques
6565
case ReadinessCheckService:
6666
checkName = "readiness"
6767
isPassing = isLive && s.isLeader.Load()
68-
case LivenessCheckService, "": // Default to liveness check if service is empty
68+
case "": // Handle overall server health for load balancers that use an empty service name.
69+
checkName = "empty service name (considered as overall health)"
70+
// The overall health for a load balancer should reflect readiness to accept traffic,
71+
// which is true only for the leader pod that has synced its data.
72+
isPassing = isLive && s.isLeader.Load()
73+
case LivenessCheckService:
6974
checkName = "liveness"
7075
// Any pod that is running and can respond to this gRPC check is considered "live".
7176
// The datastore sync status should not affect liveness, only readiness.

0 commit comments

Comments
 (0)