Skip to content

listener: allow changing address - #16134

Merged
ggreenway merged 12 commits into
envoyproxy:mainfrom
tbarrella:listener-address
May 5, 2021
Merged

ggreenway merged 12 commits into
envoyproxy:mainfrom
tbarrella:listener-address

Conversation

@tbarrella

@tbarrella tbarrella commented Apr 22, 2021 •

Copy link
Copy Markdown
Contributor

Commit Message:
listener: allow changing address

Signed-off-by: Taylor Barrella [email protected]

Additional Description:
Risk Level: Medium
Testing: unit and integration
Docs Changes: updated LDS docs to clarify socket reuse
Release Notes: noted new feature
Fixes #15907

Signed-off-by: Taylor Barrella <[email protected]>

@lambdai lambdai left a comment

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.

That's a good start but there is more work than this.

The previous constraint that the new listener and old listener have the same address simplify the logic. Now that the address could be different, you have to set the new SocketFactory instead of using the existing active or existing warming.

@ggreenway

Copy link
Copy Markdown
Member

Drive-by comment: This will need an integration test.

Signed-off-by: Taylor Barrella <[email protected]>
Signed-off-by: Taylor Barrella <[email protected]>
@tbarrella
tbarrella requested a review from lambdai April 23, 2021 23:54

@lambdai lambdai left a comment

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.

EXPECT_EQ(test_server_->server().listenerManager().listeners().size(), 1);
registerTestServerPorts({listener_name_});

const std::string route_config_tmpl = R"EOF(

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.

nit: the route config can be defined within the http conn manager so we don't use the rds stream here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think rds could be used here to prevent the listener from completing warming.

This brings up an interesting question: I'm not sure what the expected semantics are when the new listener is still warming. Should the old listener be guaranteed to still be accepting connections until the new listener is done warming? This is more complicated with the listener address changing. I think it wouldn't be in the case of localhost->wildcard, but unicast->different unicast it could matter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

By this being more complicated, do you mean the logic should be different from when a listener is normally updated (without changing the address)? Anyway, from my understanding, the old listener isn't drained until the new one is warmed: https://github.com/envoyproxy/envoy/blob/v1.18.2/source/server/listener_manager_impl.cc#L749

Comment thread source/server/listener_manager_impl.cc Resolved
@tbarrella
tbarrella requested a review from lambdai April 27, 2021 22:21
@tbarrella

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16134 (comment) was created by @tbarrella.

see: more, trace.

@lambdai lambdai left a comment

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.

LGTM modulo the how far the integration est should go.

Leave @ggreenway for the further comment

@ggreenway ggreenway left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the code looks good, but we need to figure out if there are any tricky semantics to define regarding warming after an address change.

EXPECT_EQ(test_server_->server().listenerManager().listeners().size(), 1);
registerTestServerPorts({listener_name_});

const std::string route_config_tmpl = R"EOF(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think rds could be used here to prevent the listener from completing warming.

This brings up an interesting question: I'm not sure what the expected semantics are when the new listener is still warming. Should the old listener be guaranteed to still be accepting connections until the new listener is done warming? This is more complicated with the listener address changing. I think it wouldn't be in the case of localhost->wildcard, but unicast->different unicast it could matter.

@tbarrella

Copy link
Copy Markdown
Contributor Author

Thank you for the reviews; updated in response to a couple comments while waiting to hear back about the others

@tbarrella
tbarrella requested a review from ggreenway April 29, 2021 21:52

@ggreenway ggreenway left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This brings up an interesting question: I'm not sure what the expected semantics are when the new listener is still warming. Should the old listener be guaranteed to still be accepting connections until the new listener is done warming? This is more complicated with the listener address changing. I think it wouldn't be in the case of localhost->wildcard, but unicast->different unicast it could matter.

@tbarrella I think the behavior on the semantics of this should be documented. My initial impression is that what I described above (old listener should be open until new one is warmed) is probably the correct semantic, but I'm open to discussing that if anyone else feels differently. @alyssawilk or @mattklein123 ? And I think that we need to test/validate those semantics.

@tbarrella

tbarrella commented Apr 30, 2021 •

Copy link
Copy Markdown
Contributor Author

Overall that makes sense to me, although this process of updating a listener and having two at the same time is something that has already been happening for a while. Is it that something additional/special needs to be documented/tested in the case of changing the address?

Signed-off-by: Taylor Barrella <[email protected]>
@tbarrella
tbarrella requested a review from ggreenway April 30, 2021 17:37
@tbarrella

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16134 (comment) was created by @tbarrella.

see: more, trace.

@tbarrella

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16134 (comment) was created by @tbarrella.

see: more, trace.

@ggreenway

Copy link
Copy Markdown
Member

Overall that makes sense to me, although this process of updating a listener and having two at the same time is something that has already been happening for a while. Is it that something additional/special needs to be documented/tested in the case of changing the address?

That's a fair point. I read the existing docs, and I think they correctly describe this new mode: https://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/lds.html. But please update the sentence Thus, when a listener is updated, an entirely new listener is created (with the same listen socket) to reflect that the listening socket isn't reused if the address changes, or some other update to these docs.

/wait

Signed-off-by: Taylor Barrella <[email protected]>
@tbarrella

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16134 (comment) was created by @tbarrella.

see: more, trace.

@tbarrella

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16134 (comment) was created by @tbarrella.

see: more, trace.

@tbarrella
tbarrella requested a review from lambdai May 5, 2021 16:58
@ggreenway
ggreenway dismissed lambdai’s stale review May 5, 2021 19:01

@lambdai already approved this; github is being weird thinking there are still changes requested

@ggreenway
ggreenway merged commit 48969ea into envoyproxy:main May 5, 2021
@tbarrella

Copy link
Copy Markdown
Contributor Author

Thank you for the reviews!

@tbarrella
tbarrella deleted the listener-address branch May 5, 2021 19:21
gokulnair pushed a commit to gokulnair/envoy that referenced this pull request May 6, 2021
* listener: allow changing address

Signed-off-by: Taylor Barrella <[email protected]>
Signed-off-by: Gokul Nair <[email protected]>
gokulnair pushed a commit to gokulnair/envoy that referenced this pull request May 6, 2021
* listener: allow changing address

Signed-off-by: Taylor Barrella <[email protected]>
Signed-off-by: Gokul Nair <[email protected]>
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.

Can Envoy allow changing address in a listener config update?

3 participants