Skip to content

http: fixing UPSTREAM_REMOTE_ADDRESS for happy eyeballs, proxied connections#23139

Merged
yanavlasov merged 4 commits intoenvoyproxy:mainfrom
alyssawilk:upstream_address
Sep 19, 2022
Merged

http: fixing UPSTREAM_REMOTE_ADDRESS for happy eyeballs, proxied connections#23139
yanavlasov merged 4 commits intoenvoyproxy:mainfrom
alyssawilk:upstream_address

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk commented Sep 15, 2022

Upstream host is already accessible, but in the case of proxying or happy eyeballs, one can't always infer the address from the host, so adding the remote address to the UpstreamStreamInfo and using it in place of the host's first address.

This also changes the default IPv4 upstream address in integration tests from 0.0.0.0 to 127.0.0.1 rather than snag the port across all addresses.

Risk Level: medium but guarded
Testing: integration test
Docs Changes: n/a
Release Notes: inline

@alyssawilk
Copy link
Copy Markdown
Contributor Author

@Augustyniak is having this in stream info sufficient for you folks, or do you want it in access logs as well?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
adisuissa
adisuissa previously approved these changes Sep 19, 2022
Copy link
Copy Markdown
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for refactoring the connection_info.
LGTM.

/assign-from @envoyproxy/senior-maintainers

@repokitteh-read-only
Copy link
Copy Markdown

@envoyproxy/senior-maintainers assignee is @yanavlasov

🐱

Caused by: a #23139 (review) was submitted by @adisuissa.

see: more, trace.

@alyssawilk
Copy link
Copy Markdown
Contributor Author

/wait on CI

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Augustyniak
Augustyniak previously approved these changes Sep 19, 2022
Copy link
Copy Markdown
Contributor

@Augustyniak Augustyniak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for us - It will be handy to have this in our proxy tests - thank you!.

One comment - not sure about the name of added headers it self - remote_address. I think that Envoy usually prefixes its headers with x-envoy and uses - as opposed to _ to separate words

@Augustyniak
Copy link
Copy Markdown
Contributor

Augustyniak commented Sep 19, 2022

I would rename remote_address to remote-address and consider adding x-envoy- prefix to the final name of the header.

@alyssawilk
Copy link
Copy Markdown
Contributor Author

Ah, looks like that can be added to response headers via UPSTREAM_REMOTE_ADDRESS only it's arguably broken for H-A and proxying so I'll go fix that. Thanks!

@alyssawilk
Copy link
Copy Markdown
Contributor Author

/wait

@alyssawilk alyssawilk changed the title http: adding upstream address to stream info http: fixing UPSTREAM_REMOTE_ADDRESS for happy eyeballs, proxied connections Sep 19, 2022
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/wait

Comment thread changelogs/current.yaml Outdated
# *Changes that may cause incompatibilities for some users, but should not for most*
- area: logging
change: |
changed the ``UPSTREAM_REMOTE_ADDRESS``, ``UPSTREAM_REMOTE_ADDRESS_WITHOUT_PORT``, and ``UPSTREAM_REMOTE_PORT`` fields to log based on the actual upstream connection rather than the upstream host. This fixes a bug where the address components were not consistently correct for Happy Eyeballs connections and proxied connections, but also means in cases where the host was selected but a connection was not established, the fields will be absent. This change can be temporarily reverted by setting the runtime guard ``envoy.reloadable_features.correct_upstream_address`` to false.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct_upstream_address -> correct_remote_address

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@yanavlasov yanavlasov enabled auto-merge (squash) September 19, 2022 20:34
@yanavlasov yanavlasov merged commit 1fabd6d into envoyproxy:main Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants