Conversation
This is essentially a form of fallback that falls back when a primary service takes too long to become ready. When the primary service's `poll_ready` does not return ready for over the specified duration, the secondary service is used until the primary becomes ready again, resetting the readiness timeout. Erros from both services are propagated. I considered naming this `ReadyFallback`, but that name was already used for an unrelated type in the `fallback` module. :)
olix0r
requested changes
Oct 6, 2020
Member
olix0r
left a comment
There was a problem hiding this comment.
This looks really good! Thanks for tests.
- Let's skip the layer impl for now and instead expose a SwitchReady::new
- Let's base this directly off of
mainso it can merge independently?
Signed-off-by: Eliza Weisman <[email protected]>
…kerd2-proxy into eliza/ver/profile-no-timeout
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
also tried to make names clearer Signed-off-by: Eliza Weisman <[email protected]>
olix0r
reviewed
Oct 7, 2020
olix0r
approved these changes
Oct 7, 2020
linkerd/stack/src/switch_ready.rs
Outdated
| impl<A, B, R> tower::Service<R> for SwitchReady<A, B> | ||
| where | ||
| A: tower::Service<R>, | ||
| B: tower::Service<R, Response = A::Response, Error = A::Error>, |
Member
There was a problem hiding this comment.
note that if you use tower::util::Either, you don't need to require that the error types are the same (though they both need to be Into<Error>)
Contributor
Author
There was a problem hiding this comment.
didn't realize Either was Into<Error> when both arms are Into<Error>...mainly i thought i'd avoid adding a map_err here that could be added in a separate layer?
Contributor
Author
There was a problem hiding this comment.
oh, i see, it has a future impl, that's neat
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Oct 10, 2020
This release overhauls the discovery and routing logic implemented by the proxy: instead of looking at HTTP request metadata for service discovery, the outbound proxy now exclusively use each connection's target IP:PORT. This eager resolution eliminates per-request cache binding; and supports using TrafficSplit with non-HTTP services. This has a few side effects: - The `l5d-dst-override` header is no longer honored. - When the application attempts to connect to a pod IP, the proxy no longer load balances these requests among all pods in the service. The proxy will now honor session-stickiness as selected by an application-level load balancer. - `TrafficSplits` are only applied when a client targets a service's IP. - The proxy no longer performs DNS "canonicalization" to translate relative host header names to a fully-qualified form. --- * Unify RequestFilter and Admit middlewares (linkerd/linkerd2-proxy#692) * Only allow name-based profile discovery for inbound requests (linkerd/linkerd2-proxy#695) * outbound: initial tests for TCP mTLS (with fewer moving parts) (linkerd/linkerd2-proxy#693) * Stop honoring DESTINATION_GET_* configuration (linkerd/linkerd2-proxy#696) * stack: add SwitchReady service (linkerd/linkerd2-proxy#694) * telemetry: Remove trailing comma in build_info labels (linkerd/linkerd2-proxy#699) * Update Rust to 1.47.0 (linkerd/linkerd2-proxy#701)
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Oct 12, 2020
This release overhauls the discovery and routing logic implemented by the proxy: instead of looking at HTTP request metadata for service discovery, the outbound proxy now exclusively use each connection's target IP:PORT. This eager resolution eliminates per-request cache binding; and supports using TrafficSplit with non-HTTP services. This has a few side effects: - The `l5d-dst-override` header is no longer honored. - When the application attempts to connect to a pod IP, the proxy no longer load balances these requests among all pods in the service. The proxy will now honor session-stickiness as selected by an application-level load balancer. - `TrafficSplits` are only applied when a client targets a service's IP. - The proxy no longer performs DNS "canonicalization" to translate relative host header names to a fully-qualified form. --- * Unify RequestFilter and Admit middlewares (linkerd/linkerd2-proxy#692) * Only allow name-based profile discovery for inbound requests (linkerd/linkerd2-proxy#695) * outbound: initial tests for TCP mTLS (with fewer moving parts) (linkerd/linkerd2-proxy#693) * Stop honoring DESTINATION_GET_* configuration (linkerd/linkerd2-proxy#696) * stack: add SwitchReady service (linkerd/linkerd2-proxy#694) * telemetry: Remove trailing comma in build_info labels (linkerd/linkerd2-proxy#699) * Update Rust to 1.47.0 (linkerd/linkerd2-proxy#701) * cache: Delete benchmarks (linkerd/linkerd2-proxy#705) * outbound: Discover profiles for each unique TCP target (linkerd/linkerd2-proxy#704)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is essentially a form of fallback that falls back when a primary
service takes too long to become ready. When the primary service's
poll_readydoes not return ready for over the specified duration, thesecondary service is used until the primary becomes ready again,
resetting the readiness timeout. Erros from both services are
propagated.
I considered naming this
ReadyFallback, but that name was already usedfor an unrelated type in the
fallbackmodule. :)