[ CHORE]: RoadRunner readiness check fails when all workers are busy, causing cascading pod removal
No duplicates .
- I have searched for a similar issue.
What should be improved or cleaned up?
We identified a potentially dangerous behavior in RoadRunner's HTTP readiness check.
The current readiness implementation checks whether there is an available worker. When all workers are busy processing requests, the readiness endpoint returns a failure response.
This creates an undesirable interaction with Kubernetes readiness probes:
- Traffic increases and RoadRunner workers become busy processing requests.
- The readiness check reports the pod as not ready because no worker is currently available.
- Kubernetes removes the pod from Service endpoints.
- The remaining pods receive more traffic.
- Their workers become saturated as well.
- Their readiness checks start failing and Kubernetes removes them too.
Under sufficiently high load, this creates a cascading failure where healthy pods that are actively processing requests are progressively removed from load balancing.
In our case, this eventually resulted in all pods being removed from the Service endpoints and caused an outage.
Expected behavior
A pod being temporarily saturated should not necessarily mean that the pod itself is unhealthy or should be removed from Kubernetes Service endpoints.
The readiness endpoint should indicate whether RoadRunner is capable of serving traffic, rather than fail simply because all workers happen to be processing requests at the exact moment the readiness probe executes.
Current behavior
The readiness implementation appears to determine readiness based on worker availability:
https://github.com/roadrunner-server/http/blob/master/status.go#L31
This couples Kubernetes readiness with instantaneous worker utilization and can create a positive feedback loop during periods of high load.
Workaround
We stopped using RoadRunner's readiness endpoint for the Kubernetes readiness probe and instead configured Kubernetes to call our application's own /healthz endpoint.
This prevents temporary worker saturation from causing Kubernetes to remove otherwise healthy pods from Service endpoints.
Source: roadrunner-server/roadrunner