forked from linkerd/linkerd2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove redundant reconnect logic (linkerd#87)
`bind::BoundService` wraps a `Reconnect` service and handles its Connect errors. However, `BoundService` exposes `Reconnect`'s Error type to callers even though these errors can never be returned. Furthermore, `Reconnect` is allowed be polled after returning an error, triggering the inner service to be rebuilt. We needlessly duplicate this logic in `BoundService`. Before splitting this file up into smaller chunks, let's update `BoundService` to more narrowly adhere to `Reconnect`s API: - Only the inner error type is returned. `unreachable!` assertions have been made where error variants cannot be returned. - Do not "rebind" the stack explicitly. Instead, let `Reconnect` do this. - Now BoundService::call may panic if invoked before poll_ready. It's a programming error, since `Reconnect` requires that `poll_ready` be called first.
- Loading branch information
Showing
1 changed file
with
61 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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