Repository navigation
proxy protocol: Add http support. - #16598
Conversation
Signed-off-by: Weston Carlson <[email protected]>
Signed-off-by: Weston Carlson <[email protected]>
Signed-off-by: Weston Carlson <[email protected]>
|
cc @ggreenway who is looking at related proxy proto issues. As I mentioned in the linked issue, I don't think this change by itself makes sense. Because of how Envoy decouples the upstream connection pool from the downstream connection and does keep alive, this change will end up sending requests for different clients to an upstream connection that has the wrong proxy proto already sent. The only way this makes sense is if we have a dedicated connection pool / connection for each unique downstream client. Iirc this is actually possible with various config options, but imo at minimum we need to document this, and even then it's so prone to breaking I would rather enforce in code somehow. |
|
I agree there are a lot of caveat's, but it's neccessary if one doesn't control the upstream, and the upstream expects PROXY protocol. Definitely need good docs at a minimum. Ideally, there would be a mechanism to close the upstream connection(s) when the downstream connection closes. I'm not exactly sure how this would be implemented. An alternative is documenting (or enforcing) and low idle timeout on the upstream connections. This would be a case where global config validation (not per-filter) is useful. |
|
Shouldn't the connection pool be unique for clients due to the proxy proto header info being in the hash? i.e. https://github.com/envoyproxy/envoy/pull/13768/files#diff-54d8fe86c68f5ce79e1ebcf1994b13096632b8897b26591910b86a2b05e50064R47. Agree on it being ideal if upstream connection was closed when downstream was closed. I could potentially look into that more but would also be open to the low timeout / documentation approach. Just wanted to confirm my understanding, we don't have a global validator currently, right? |
|
Ok sorry I forgot that the proxy proto setting already effects the hash. Part of me wonders of this change should be config guarded, which could then be used to pivot on extra checks? I have a few other concerns but let me follow up with @ggreenway first offline. |
alyssawilk
left a comment
There was a problem hiding this comment.
Oh that was much cleaner and easier than expected - all the prior work here really paid off :-)
+1 to more docs. Itd probably be worth calling out in release notes you do this by using setting the (reflink) proxy protocol filter. It's also worth calling out the hit upstream will take to connection resue.
Signed-off-by: Weston Carlson <[email protected]>
alyssawilk
left a comment
There was a problem hiding this comment.
Thanks for the docs! PR LGTM modulo one tiny nit.
Signed-off-by: Weston Carlson <[email protected]>
Signed-off-by: Weston Carlson <[email protected]>
|
Sorry about dismissing your review @alyssawilk, I found one more grammar issue in the docs. |
|
I recently discovered #16682, which will also apply to http with upstream PROXY protocol. I think we should either document that this new code has this defect until that issue is fixed, or wait for the fix for that issue. |
|
My vote would be to document the defect and merge this for now. Mainly because the defect already exists (and for more than just proxy protocol, but it's probably the most affected) and this code mainly just fixes the proxy protocol header sent using http connection manager currently. As noted by other issues, people are trying to use this socket with http connection manager already and noticing the addresses are wrong. I could see the argument against this though being having it in the release notes might means wider adoption and more people hitting this issue. We (Digitalocean) will likely want the memory issue fixed in the near future as well though. I could potentially look into resurrecting the idle timeout PR that would have fixed the issue, but I don't want to step on anybody's toes. Thoughts @ggreenway? |
|
I am working on a fix for the leak right now. I'll should have a PR within a week. I'm fine with merging this with extra docs noting the defect. Can you find a good spot where the note will be seen? Maybe also include it in the release note, and assuming this is fixed before the next release (very likely), we can edit that part out of the release note. Seem reasonable? |
|
SGTM! |
Signed-off-by: Weston Carlson <[email protected]>
|
Ready for another look @ggreenway. I've added defect notes to the proxy protocol section that mentions the socket. Since it mainly affects pp, I thought this would be okay. I'm not sure of a more generic place to document this issue. Also added a link to the issue in the release notes. |
ggreenway
left a comment
There was a problem hiding this comment.
LGTM. @alyssawilk and @mattklein123 any further comments?
|
Still LGTM! Matt you OK merging with the defect given docs? |
|
Thanks everyone for taking the time to review! |
Commit Message: Add http proxy proto support. Additional Description: The main addition here is setting the proxy protocol filter state information so that the upstream proxy proto transport socket can use that info to properly generate the header. Risk Level: medium? Testing: functional, integration Docs Changes: Added details to IP Transparency page for using proxy proto with HTTP Release Notes: Added note for http proxy proto support Fixes envoyproxy#15463 Signed-off-by: Weston Carlson <[email protected]>
Signed-off-by: Weston Carlson [email protected]
Commit Message: Add http proxy proto support.
Additional Description: The main addition here is setting the proxy protocol filter state information so that the upstream proxy proto transport socket can use that info to properly generate the header.
Risk Level: medium?
Testing: functional, integration
Docs Changes: Added details to IP Transparency page for using proxy proto with HTTP
Release Notes: Added note for http proxy proto support
Fixes #15463