Skip to content

Commit 8f1b967

Browse files
authored
outbound: Restore spawn-ready (#679)
The spawn-ready layer was removed in 1382e32; but this means that endpoint-level services aren't necessarily driven to readiness. This can manifest in TLS detection timeouts, since a client may not be driven through the TLS handshake. This change removes the `push_spawn_ready` helper, because it's really a `push_make_spawn_ready` and the make layer is totally superfluous.
1 parent a6ba155 commit 8f1b967

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

linkerd/app/core/src/svc.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::time::Duration;
1313
use tower::layer::util::{Identity, Stack as Pair};
1414
pub use tower::layer::Layer;
1515
pub use tower::make::MakeService;
16-
use tower::spawn_ready::SpawnReadyLayer;
16+
pub use tower::spawn_ready::SpawnReady;
1717
pub use tower::util::{Either, Oneshot};
1818
pub use tower::{service_fn as mk, Service, ServiceExt};
1919

@@ -99,10 +99,6 @@ impl<L> Layers<L> {
9999
self.push(stack::OnResponseLayer::new(layer))
100100
}
101101

102-
pub fn push_spawn_ready(self) -> Layers<Pair<L, SpawnReadyLayer>> {
103-
self.push(SpawnReadyLayer::new())
104-
}
105-
106102
pub fn push_concurrency_limit(self, max: usize) -> Layers<Pair<L, concurrency_limit::Layer>> {
107103
self.push(concurrency_limit::Layer::new(max))
108104
}
@@ -209,10 +205,6 @@ impl<S> Stack<S> {
209205
self.push(stack::OnResponseLayer::new(layer))
210206
}
211207

212-
pub fn push_spawn_ready(self) -> Stack<tower::spawn_ready::MakeSpawnReady<S>> {
213-
self.push(SpawnReadyLayer::new())
214-
}
215-
216208
pub fn push_concurrency_limit(
217209
self,
218210
max: usize,

linkerd/app/outbound/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ impl Config {
292292
let discover = svc::layers()
293293
.push(discover::resolve(map_endpoint::Resolve::new(
294294
endpoint::FromMetadata,
295-
resolve.clone(),
295+
resolve,
296296
)))
297297
.push(discover::buffer(1_000, cache_max_idle_age));
298298

@@ -301,6 +301,7 @@ impl Config {
301301
.check_new_service::<HttpEndpoint, http::Request<http::boxed::Payload>>()
302302
.push_on_response(
303303
svc::layers()
304+
.push(svc::layer::mk(svc::SpawnReady::new))
304305
.push(metrics.stack.layer(stack_labels("balance.endpoint")))
305306
.box_http_request(),
306307
)
@@ -332,6 +333,7 @@ impl Config {
332333
let logical = concrete
333334
// Uses the split-provided target `Addr` to build a concrete target.
334335
.push_map_target(HttpConcrete::from)
336+
.push_on_response(svc::layers().push(svc::layer::mk(svc::SpawnReady::new)))
335337
.push(profiles::split::layer())
336338
// Drives concrete stacks to readiness and makes the split
337339
// cloneable, as required by the retry middleware.

0 commit comments

Comments
 (0)