New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a NewServeHttp::layer helper #793
Conversation
Now that `NewServeHttp` takes a single inner stack, we can instrument as a simple layer. This change replaces the modules' constructor with a layer and consolidates the inbound HTTP server stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, seems good!
@@ -349,20 +349,29 @@ impl Config { | |||
.. | |||
} = self.proxy.clone(); | |||
|
|||
// Handles requests as they are initially received by the proxy. | |||
let http_admit_request = svc::layers() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit/tioli: i kind of liked having this factored out, but nbd...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that it was split out helped hide the fact that we had redundant failfast modules -- one in the admit layers and another inside the buffer. It's a bit easier to reason about as one big list...
This release adds a new `/shutdown` admin endpoint that may only be accessed over the loopback network. This allows batch jobs to gracefully terminate the proxy on completion. The `linkerd-await` utility can be used to automate this. This release also includes ~33 non-user-facing changes, the most important of which updates the Linkerd Transport Header preface to be `transport.l5d.io/v1\r\n\r\n`. --- * Simplify orig_proto::Downgrade intializaiton (linkerd/linkerd2-proxy#796) * Remove unused make_response module (linkerd/linkerd2-proxy#792) * Add MakeNormalizeUri::layer helper (linkerd/linkerd2-proxy#794) * Simplify tcp::Forward stack initialization (linkerd/linkerd2-proxy#797) * Add a NewServeHttp::layer helper (linkerd/linkerd2-proxy#793) * Simplify outbound endpoint stakc creation (linkerd/linkerd2-proxy#798) * Simplify NewRouter initialization (linkerd/linkerd2-proxy#795) * Remove unused http::add_header module (linkerd/linkerd2-proxy#800) * Simplify concurrency-limit initialization (linkerd/linkerd2-proxy#799) * Remove the strip_header::Layer type (linkerd/linkerd2-proxy#801) * Simplify http-classify stack initialization (linkerd/linkerd2-proxy#804) * Simplify HTTP metrics initialization (linkerd/linkerd2-proxy#806) * Add checks to ensure support for opaque transport (linkerd/linkerd2-proxy#808) * Remove the override_authority::Layer type (linkerd/linkerd2-proxy#802) * Simplify tls::client module (linkerd/linkerd2-proxy#809) * Simplify header_from_target stack initialization (linkerd/linkerd2-proxy#803) * Cleanup HTTP boxing modules (linkerd/linkerd2-proxy#805) * Include scope names in failfast error messages (linkerd/linkerd2-proxy#791) * Simplify drain module implementation (linkerd/linkerd2-proxy#810) * Simplify BoxNewService initialization (linkerd/linkerd2-proxy#807) * admin: Add a /shutdown endpoint (linkerd/linkerd2-proxy#811) * stack: Remove the MakeReady helper (linkerd/linkerd2-proxy#813) * Remove the stack::Oneshot helper (linkerd/linkerd2-proxy#812) * http: Simplify http::boxed type references (linkerd/linkerd2-proxy#814) * Simplify stack type constraints (linkerd/linkerd2-proxy#815) * Rename transport types to ConnectTcp and BindTcp (linkerd/linkerd2-proxy#819) * Remove box from inbound connector (linkerd/linkerd2-proxy#816) * tap: Simplify tap initialization (linkerd/linkerd2-proxy#820) * Update Rust to 1.49.0 (linkerd/linkerd2-proxy#822) * Avoid boxing I/O types for optional TLS (linkerd/linkerd2-proxy#817) * Decouple TLS detection from TCP connections (linkerd/linkerd2-proxy#818) * stack: Rename NewOptional to NewUnwrapOr (linkerd/linkerd2-proxy#824) * inbound: Decouple inbound stack from TCP connections (linkerd/linkerd2-proxy#823) * Rename opaque-transport to transport-header (linkerd/linkerd2-proxy#825)
This release adds a new `/shutdown` admin endpoint that may only be accessed over the loopback network. This allows batch jobs to gracefully terminate the proxy on completion. The `linkerd-await` utility can be used to automate this. This release also includes ~33 non-user-facing changes, the most important of which updates the Linkerd Transport Header preface to be `transport.l5d.io/v1\r\n\r\n`. --- * Simplify orig_proto::Downgrade intializaiton (linkerd/linkerd2-proxy#796) * Remove unused make_response module (linkerd/linkerd2-proxy#792) * Add MakeNormalizeUri::layer helper (linkerd/linkerd2-proxy#794) * Simplify tcp::Forward stack initialization (linkerd/linkerd2-proxy#797) * Add a NewServeHttp::layer helper (linkerd/linkerd2-proxy#793) * Simplify outbound endpoint stakc creation (linkerd/linkerd2-proxy#798) * Simplify NewRouter initialization (linkerd/linkerd2-proxy#795) * Remove unused http::add_header module (linkerd/linkerd2-proxy#800) * Simplify concurrency-limit initialization (linkerd/linkerd2-proxy#799) * Remove the strip_header::Layer type (linkerd/linkerd2-proxy#801) * Simplify http-classify stack initialization (linkerd/linkerd2-proxy#804) * Simplify HTTP metrics initialization (linkerd/linkerd2-proxy#806) * Add checks to ensure support for opaque transport (linkerd/linkerd2-proxy#808) * Remove the override_authority::Layer type (linkerd/linkerd2-proxy#802) * Simplify tls::client module (linkerd/linkerd2-proxy#809) * Simplify header_from_target stack initialization (linkerd/linkerd2-proxy#803) * Cleanup HTTP boxing modules (linkerd/linkerd2-proxy#805) * Include scope names in failfast error messages (linkerd/linkerd2-proxy#791) * Simplify drain module implementation (linkerd/linkerd2-proxy#810) * Simplify BoxNewService initialization (linkerd/linkerd2-proxy#807) * admin: Add a /shutdown endpoint (linkerd/linkerd2-proxy#811) * stack: Remove the MakeReady helper (linkerd/linkerd2-proxy#813) * Remove the stack::Oneshot helper (linkerd/linkerd2-proxy#812) * http: Simplify http::boxed type references (linkerd/linkerd2-proxy#814) * Simplify stack type constraints (linkerd/linkerd2-proxy#815) * Rename transport types to ConnectTcp and BindTcp (linkerd/linkerd2-proxy#819) * Remove box from inbound connector (linkerd/linkerd2-proxy#816) * tap: Simplify tap initialization (linkerd/linkerd2-proxy#820) * Update Rust to 1.49.0 (linkerd/linkerd2-proxy#822) * Avoid boxing I/O types for optional TLS (linkerd/linkerd2-proxy#817) * Decouple TLS detection from TCP connections (linkerd/linkerd2-proxy#818) * stack: Rename NewOptional to NewUnwrapOr (linkerd/linkerd2-proxy#824) * inbound: Decouple inbound stack from TCP connections (linkerd/linkerd2-proxy#823) * Rename opaque-transport to transport-header (linkerd/linkerd2-proxy#825)
Now that
NewServeHttp
takes a single inner stack, we can instrument asa simple layer.
This change replaces the modules' constructor with a layer and
consolidates the inbound HTTP server stack.