outbound: Return a default endpoint on reject#690
Conversation
When the resolver rejects resolution, we currently propagate that error so that it can be handled via fallback. And due to recent HTTP router changes, these resolution errors can propagate up across splits, etc. This change simplifies this behavior by isntead synthesizing a resolution with a default endpoint. The `not_http` reason has been removed, as it's no longer useful.
hawkw
left a comment
There was a problem hiding this comment.
lgtm, commented on a few minor things that aren't blockers
| #[derive(Clone, Debug)] | ||
| pub struct RecoverDefaultResolve<S>(S); |
There was a problem hiding this comment.
nit: it'd be nice to have a comment explaining what this does --- the name is about as descriptive as i can think of, but i can see the purpose of this thing not being immediately obvious to new contributors?
| #[derive(Clone, Debug)] | ||
| pub struct Rejected(()); |
There was a problem hiding this comment.
nit: maybe worth a comment on the semantics of what this error means?
| .or_else(move |error| { | ||
| if Rejected::matches(&*error) { | ||
| tracing::debug!(%error, %addr, "Synthesizing endpoint"); |
There was a problem hiding this comment.
nit/TIOLI: if we added addr to this message by instrumenting the future instead of moving it in, we wouldn't need this to be a move closure and could therefore remove the box around the future (since it's just combinators). not a blocker though; and the concrete type is probably pretty gross...
There was a problem hiding this comment.
The addr is used on the next line (as part of the returend stream), so the move is needed either way. And, really, the addr is already on the context, so we could omit it here, but 🤷♂️
There was a problem hiding this comment.
whoops, i overlooked that --- carry on!
|
I'll add comments in #691 |
This release includes changes to TCP metrics to ensure that peer identities are encoded via the `client_id` and `server_id` labels. --- * outbound: Explicitly ignore the source address for tap (linkerd/linkerd2-proxy#680) * Update proxy-api and tonic (linkerd/linkerd2-proxy#682) * http: Lazily build http/tcp stacks (linkerd/linkerd2-proxy#681) * outbound: Remove required identity from HttpLogical (linkerd/linkerd2-proxy#683) * profiles: Expose the fully_qualified_name (linkerd/linkerd2-proxy#684) * request-filter: Support altering the request type (linkerd/linkerd2-proxy#685) * tracing: Set contexts in new_service/make_service (linkerd/linkerd2-proxy#686) * discover: Allow resolution streams to terminate (linkerd/linkerd2-proxy#689) * metrics: add peer identities to all TLS metric labels (linkerd/linkerd2-proxy#687) * outbound: Return a default endpoint on reject (linkerd/linkerd2-proxy#690) * Skip endpoint resolution when profile lookup is rejected (linkerd/linkerd2-proxy#691)
This release includes changes to TCP metrics to ensure that peer identities are encoded via the `client_id` and `server_id` labels. --- * outbound: Explicitly ignore the source address for tap (linkerd/linkerd2-proxy#680) * Update proxy-api and tonic (linkerd/linkerd2-proxy#682) * http: Lazily build http/tcp stacks (linkerd/linkerd2-proxy#681) * outbound: Remove required identity from HttpLogical (linkerd/linkerd2-proxy#683) * profiles: Expose the fully_qualified_name (linkerd/linkerd2-proxy#684) * request-filter: Support altering the request type (linkerd/linkerd2-proxy#685) * tracing: Set contexts in new_service/make_service (linkerd/linkerd2-proxy#686) * discover: Allow resolution streams to terminate (linkerd/linkerd2-proxy#689) * metrics: add peer identities to all TLS metric labels (linkerd/linkerd2-proxy#687) * outbound: Return a default endpoint on reject (linkerd/linkerd2-proxy#690) * Skip endpoint resolution when profile lookup is rejected (linkerd/linkerd2-proxy#691)
When the resolver rejects resolution, we currently propagate that error
so that it can be handled via fallback. And due to recent HTTP router
changes, these resolution errors can propagate up across splits, etc.
This change simplifies this behavior by instead synthesizing a
resolution with a default endpoint.
The
not_httpreason has been removed, as it's no longer useful.