-
Notifications
You must be signed in to change notification settings - Fork 273
profiles: Do not rely on tuples as stack targets #650
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
Conversation
Using tuples for stack targets (particularly, the input targets of the route_request and split modules) is a bit brittle. Instead, we can use `AsRef` on the target type to access the profile receiver. This change introduces new target types to be used to satisfy these traits, and generally cleans up stack construction.
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.
This seems much nicer to me. IMO, this is definitely an appropriate use of AsRef
, and I like that we're now converting the discovery output into a form that's specific to the inbound/outbound profile stacks rather than messing around with tuples. Looks good to me!
S: tower::Service<Req>, | ||
{ | ||
type Service = Split<T, N, S, Req>; | ||
|
||
fn new_service(&self, (rx, target): (Receiver, T)) -> Self::Service { | ||
fn new_service(&self, target: T) -> Self::Service { | ||
let rx = target.as_ref().clone(); |
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.
This does add a clone + drop of the receiver that wasn't previously necessary...I don't think this is hot enough to care about an atomic ref bump, though.
This release includes several major changes to the proxy's behavior: - Service profile lookups are now necessary and fundamental to outbound discovery for HTTP traffic. That is, if a service profile lookup is rejected, endpoint discovery will not be performed; and endpoint discovery must succeed for all destinations that are permitted by service profiles. This simplifies caching and buffering to reduce latency (especially under concurrency). - Service discovery is now performed for all TCP traffic, and connections are balanced over endpoints according to connection latency. - This enables mTLS for **all** meshed connections; not just HTTP. - Outbound TCP metrics are now hydrated with endpoint-specific labels. --- * outbound: Cache balancers within profile stack (linkerd/linkerd2-proxy#641) * outbound: Remove unused error type (linkerd/linkerd2-proxy#648) * Eliminate the ConnectAddr trait (linkerd/linkerd2-proxy#649) * profiles: Do not rely on tuples as stack targets (linkerd/linkerd2-proxy#650) * proxy-http: Remove unneeded boilerplate (linkerd/linkerd2-proxy#651) * outbound: Clarify Http target types (linkerd/linkerd2-proxy#653) * outbound: TCP discovery and load balancing (linkerd/linkerd2-proxy#652) * metrics: Add endpoint labels to outbound TCP metrics (linkerd/linkerd2-proxy#654)
This release includes several major changes to the proxy's behavior: - Service profile lookups are now necessary and fundamental to outbound discovery for HTTP traffic. That is, if a service profile lookup is rejected, endpoint discovery will not be performed; and endpoint discovery must succeed for all destinations that are permitted by service profiles. This simplifies caching and buffering to reduce latency (especially under concurrency). - Service discovery is now performed for all TCP traffic, and connections are balanced over endpoints according to connection latency. - This enables mTLS for **all** meshed connections; not just HTTP. - Outbound TCP metrics are now hydrated with endpoint-specific labels. --- * outbound: Cache balancers within profile stack (linkerd/linkerd2-proxy#641) * outbound: Remove unused error type (linkerd/linkerd2-proxy#648) * Eliminate the ConnectAddr trait (linkerd/linkerd2-proxy#649) * profiles: Do not rely on tuples as stack targets (linkerd/linkerd2-proxy#650) * proxy-http: Remove unneeded boilerplate (linkerd/linkerd2-proxy#651) * outbound: Clarify Http target types (linkerd/linkerd2-proxy#653) * outbound: TCP discovery and load balancing (linkerd/linkerd2-proxy#652) * metrics: Add endpoint labels to outbound TCP metrics (linkerd/linkerd2-proxy#654)
Using tuples for stack targets (particularly, the input targets of the
route_request and split modules) is a bit brittle. Instead, we can use
AsRef
on the target type to access the profile receiver.This change introduces new target types to be used to satisfy these
traits, and generally cleans up stack construction.