-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(app/core): prepare rescue body for http-body upgrade
this commit makes some minor alterations to our error recovery body middleware. see linkerd/linkerd2#8733 for more information. this commit removes an `assert!` statement from the implementation of `<Response<R, B> as Body>::poll_data()`. see the documentation of `Body::poll_frame()`: > Once the end of the stream is reached, implementations should > continue to return [`Poll::Ready(None)`]. hyperium/http-body@1090bff#diff-33aabe8c2aaa7614022addf244245e09bbff576a67a9ae3c6938c8a868201d36R60-R61 to do this, this commit introduces a distinct terminal state `Inner::Rescued` to represent when the underlying `B`-typed body has yielded an error and been rescued. once in this state the body will yield no more data frames, instead yielding a collection of trailers describing the mid-stream error that was encountered by the underlying body. the call to `R::rescue` is also moved down into the helper function fka `grpc_trailers()`. this helps the function follow the grain of our "state machine" a little more directly. see #3615, #3614, and #3611 for pretext to this change. Signed-off-by: katelyn martin <[email protected]>
- Loading branch information
Showing
1 changed file
with
61 additions
and
37 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