Skip to content

Commit

Permalink
inbound: Add a box layer to reduce compile times (#1317)
Browse files Browse the repository at this point in the history
The inbound proxy builds in 30-40 minutes on recent nightlies. This can
be reduced to 3-4 minutes with a boxing layer. This change adds such a
layer so that fuzzing builds can complete in a timely fashion.

(cherry picked from commit 66f2f03)
Signed-off-by: Oliver Gould <ver@buoyant.io>
  • Loading branch information
olix0r committed Mar 30, 2022
1 parent e384374 commit fee860b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions linkerd/app/inbound/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ http = "0.2"
linkerd-app-core = { path = "../../core" }
linkerd-app-inbound = { path = ".." }
linkerd-app-test = { path = "../../test" }
linkerd-proxy-identity = { path = "../../../proxy/identity", features = ["test-util"] }
linkerd-tracing = { path = "../../../tracing", features = ["ansi"] }
tracing = "0.1"

Expand Down
8 changes: 7 additions & 1 deletion linkerd/app/inbound/src/http/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ impl<C> Inbound<C> {
rt.span_sink.clone(),
super::trace_labels(),
))
.push_on_service(http::BoxResponse::layer());
.push_on_service(svc::layers()
.push(http::BoxResponse::layer())
// This box is needed to reduce compile times on recent (2021-10-17) nightlies,
// though this may be fixed by https://github.com/rust-lang/rust/pull/89831. It
// should be removed when possible.
.push(svc::BoxService::layer())
);

// Attempts to discover a service profile for each logical target (as
// informed by the request's headers). The stack is cached until a
Expand Down

0 comments on commit fee860b

Please sign in to comment.