Skip to content

Default disable port migration and allow it to be turned on in Envoy Mobile API#32112

Merged
alyssawilk merged 15 commits intoenvoyproxy:mainfrom
RenjieTang:add-pm
Feb 7, 2024
Merged

Default disable port migration and allow it to be turned on in Envoy Mobile API#32112
alyssawilk merged 15 commits intoenvoyproxy:mainfrom
RenjieTang:add-pm

Conversation

@RenjieTang
Copy link
Copy Markdown
Contributor

Commit Message: Default disable port migration and allow it to be turned on in Envoy Mobile API
Additional Description: Currently it can only be turned on via the C++ API. More platforms will be covered once port migration is proven to work well.
Risk Level: Low
Testing: unit tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: mobile

Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
@RyanTheOptimist
Copy link
Copy Markdown
Contributor

/assign @abeyad

Signed-off-by: Renjie Tang <renjietang@google.com>
Copy link
Copy Markdown
Contributor

@abeyad abeyad 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 doing this @RenjieTang ! Also, do we want to add this API for the other languages (java/kotlin/swift/objective-c)?

->mutable_http3_protocol_options()
->mutable_quic_protocol_options()
->mutable_num_timeouts_to_trigger_port_migration()
->set_value(4);
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.

do we want to make this value configurable too?

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.

4 is the number that we found out to be the best in previous experiment.
I'd want EM users to simply enable port migration and not worry about the number of timeouts for now.
That said, if the need to experiment with port migration rises again, I'll be happy to add it.

I also intentionally added C++ API only because I want to verify the crash is fixed first.

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.

SGTM, maybe add a comment then about 4 being the best value from previous experimentation

abeyad
abeyad previously approved these changes Jan 31, 2024
static_cast<EnvoyQuicClientConnection*>(connection())
->setNumPtosForPortMigration(PROTOBUF_GET_WRAPPED_OR_DEFAULT(
http3_options.quic_protocol_options(), num_timeouts_to_trigger_port_migration, 4));
http3_options.quic_protocol_options(), num_timeouts_to_trigger_port_migration, 0));
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.

I just realized this would turn off port migration for everyone else... I'm assuming non-mobile users aren't using it, but are we sure? we probably need to at least have a release note about this?

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.

I'm not entirely sure that this code doesn't execute anywhere else. But since it's prone to UAF issues, turning it off does more good than evil.
done adding a change log.

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.

What are the UAF issues? Should it be forcefully disabled (unconfigurable) until that is resolved?

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.

The potential issue was fixed #31702. The issue manifested in Envoy Mobile clients but not on Envoy in production. We want to default disable it but allow it to be turned on to verify the fix.

Signed-off-by: Renjie Tang <renjietang@google.com>
abeyad
abeyad previously approved these changes Jan 31, 2024
@abeyad
Copy link
Copy Markdown
Contributor

abeyad commented Jan 31, 2024

added @ggreenway for cross-company review, thanks!

Comment thread changelogs/current.yaml Outdated
Multiply the gradient value stat by 1000 to make it more granular (values will range between 500 and 2000).
- area: QUIC
change: |
Port migration is default turned off.
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.

Can you add more details to this, such as that this affects QUIC clients, what the implications may be, and link to the config knob for overriding the default?

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.

done

Signed-off-by: Renjie Tang <renjietang@google.com>
abeyad
abeyad previously approved these changes Feb 1, 2024
Copy link
Copy Markdown
Contributor

@abeyad abeyad left a comment

Choose a reason for hiding this comment

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

Will await @ggreenway approval and merge.

@abeyad
Copy link
Copy Markdown
Contributor

abeyad commented Feb 5, 2024

@ggreenway friendly ping

@abeyad
Copy link
Copy Markdown
Contributor

abeyad commented Feb 5, 2024

@RenjieTang fyi you'll need to resolve the merge conflict

Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: RenjieTang <renjietang@google.com>
Copy link
Copy Markdown
Member

@ggreenway ggreenway 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
- area: QUIC
change: |
Port migration is default turned off. QUIC client connections will no longer attempt to migrate to a new port when connections
is degrading. Can be manually turned on via num_timeouts_to_trigger_port_migration proto.
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.

nit: can you make this a link to the proto field?

ggreenway
ggreenway previously approved these changes Feb 6, 2024
RenjieTang and others added 2 commits February 6, 2024 13:41
Signed-off-by: RenjieTang <renjietang27@gmail.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
@alyssawilk alyssawilk merged commit 5575129 into envoyproxy:main Feb 7, 2024
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.

5 participants