-
I've been reading the code for linkerd-proxy and noticed that it first selects a target using EWMA (Exponentially Weighted Moving Average), and then applies circuit breaker logic to this target. If the target is in a "closed" state, the request is rejected. This means that even if a target is in a circuit-broken state, attempts are still made to send requests to it, instead of selecting another target that hasn't been circuit-broken. Or, could you provide the logic for filtering out routes that have already been circuit-broken? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You're missing an important aspect of the Service contract: readiness. The P2C balancer uses a ReadyCache to hold its inner endpoint services. The ReadyCache is responsible for only exposing an endpoint to the balancer when its Service::poll_ready returns Poll::Ready(Ok(())). The circuit breaking behavior occurs within an individual endpoint service. When the circuit breaker is tripped, the endpoint's |
Beta Was this translation helpful? Give feedback.
You're missing an important aspect of the Service contract: readiness.
The P2C balancer uses a ReadyCache to hold its inner endpoint services. The ReadyCache is responsible for only exposing an endpoint to the balancer when its Service::poll_ready returns Poll::Ready(Ok(())).
The circuit breaking behavior occurs within an individual endpoint service. When the circuit breaker is tripped, the endpoint's
Service::poll_ready
returnsPoll::Pending
until requests are allowed again, and so the balancer simply does not consider it for requests until the readiness changes.