Skip to content

Commit 3d02866

Browse files
authored
control: Ensure endpoints are driven to readiness (#1014)
When there are multiple replicas of a controller--especially the destination controller--the proxy creates a load balancer to distribute requests across all controller pods. linkerd/linkerd2#6146 describes a situation where controller connections fail to be established because the client stalls for 50s+ between initiating a connection and sending a TLS ClientHello, long after the server has timed out the idle connection. As it turns out, the controller client does not necessarily drive all of its endpoints to readiness. Because load balancers are designed to process requests when only a subset of endpoints are available, the load balancer cannot be responsible for driving all endpoints in a service to readiness and we need a `SpawnReady` layer that is responsible for driving individual endpoints to readiness. While the outbound proxy's balancers are instrumented with this layer, the controller clients were not configured this way when load balancers were introduced. We likely have not encountered this previously because the balancer should effectively hide this problem in most cases: as long as a single endpoint is available requests should be processed as expected; and if there are no endpoints available, the balancer would drive at least one to readiness in order to process requests.
1 parent 9abd27d commit 3d02866

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

linkerd/app/core/src/control.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ impl Config {
9393
.push_timeout(self.connect.timeout)
9494
.push(self::client::layer())
9595
.push(reconnect::layer(connect_backoff))
96+
// Ensure individual endpoints are driven to readiness so that the balancer need not
97+
// drive them all directly.
98+
.push_on_response(svc::layer::mk(svc::SpawnReady::new))
9699
.push(self::resolve::layer(dns, resolve_backoff))
97100
.push_on_response(self::control::balance::layer())
98101
.into_new_service()

0 commit comments

Comments
 (0)