[http] add upstreamSocketOptions and hook them into http connection pool creation#6804
Merged
mattklein123 merged 10 commits intoenvoyproxy:masterfrom May 8, 2019
Merged
Conversation
We need these to configure per-request socket options from the http filters. Signed-off-by: Kyle Larose <kyle@agilicus.com>
We use the existing mechanism used to pass socket options to the connection pool creation logic to pass the upstream socket options. We do this by creating a new socket options object, then placing both sets of socket options into it. Signed-off-by: Kyle Larose <kyle@agilicus.com>
The active stream is what's shared between the various filters. Push the options up to it so they're actually shared! Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Fix from earlier review Signed-off-by: Kyle Larose <kyle@agilicus.com>
Contributor
Author
|
@snowp As discussed, here's the PR for the router changes. |
snowp
suggested changes
May 3, 2019
Contributor
snowp
left a comment
There was a problem hiding this comment.
Thanks, looks pretty good.
- Clarify Comments - Fix grammar - Fix style Signed-off-by: Kyle Larose <kyle@agilicus.com>
Contributor
Author
|
/retest |
|
🔨 rebuilding |
Signed-off-by: Kyle Larose <kyle@agilicus.com>
snowp
previously approved these changes
May 7, 2019
Contributor
snowp
left a comment
There was a problem hiding this comment.
Nice, this looks good to me!
mattklein123
requested changes
May 7, 2019
Member
mattklein123
left a comment
There was a problem hiding this comment.
Thanks this looks great. 1 question/comment.
/wait
Remove mention of downstream connections from http filter. Signed-off-by: Kyle Larose <kyle@agilicus.com>
mattklein123
approved these changes
May 7, 2019
Member
mattklein123
left a comment
There was a problem hiding this comment.
Thanks. Can you merge master to bring in CI fixes?
Signed-off-by: Kyle Larose <kyle@agilicus.com>
The DCO is stuck :(. Try forcing it. Signed-off-by: Kyle Larose <kyle@agilicus.com>
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.
Description: Add the ability to push sock options into the upstream connection pool from an http filter.
In order to create an HTTP filter to set the source address of an upstream connection based on the
downstreamRemoteAddressof a stream, we need to be able to communicate to the connection pool creating the upstream connection the IP address we want to set. We have existing infrastructure to do this using socket options, but no way to pass socket options to the upstream on a per-http-request basis.This PR adds methods to the the
StreamDecoderFilterCallbacksso that an HTTP filter can add socket options to the callbacks. It extends theLoadBalancerContextto expose the desired upstream socket options to the connection pool logic.For the HTTP case, the socket options flow from the callback (which is an
ActiveStreamDecoderFilter) to itsActiveStreamparent. By having the parent track the socket options, every HTTP filter may add to or get the options previously added. In particular, the HTTP filter has access to them. Since it's also the LoadBalancerContext for HTTP connection pools, this completes the circle.The PR also uses the LoadBalancerContext to stitch the upstreamSocketOptions together with the downstream connection options to build the full set of options to set on the upstream.
This work was split out from #6790.
Risk Level: Medium
Testing: UT + Manual
Docs Changes: None
Release Notes: None