-
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.
retry: allow retrying requests without content-length headers (#1341)
Currently, the proxy will retry requests with bodies if and only if they have a `content-length` header with a value <= 64 KB. If the request has a body but no `content-length` header, we currently assume that its body will exceed the maximum buffered size, and skip trying to retry it. However, this means gRPC requests will never be retried, because it turns out gRPC requests don't include a `content-length` header (see linkerd/linkerd2#7141). Whoops! This PR fixes this by changing the retry logic to use `Body::size_hint` to determine if buffering should be attempted. This value will be set from `content-length` when it is set and may be set in additional situations where the body length is known before the request is processed. We are still protected against unbounded buffering because the buffering body will stop buffering and discard any previously buffered data if the buffered length ever exceeds the maximum. Co-authored-by: Oliver Gould <ver@buoyant.io> (cherry picked from commit bfc1e2c) Signed-off-by: Oliver Gould <ver@buoyant.io>
- Loading branch information
Showing
11 changed files
with
234 additions
and
106 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
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
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
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
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
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
Oops, something went wrong.