Always use IPv6 sockets on Android#21803
Conversation
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
alyssawilk
left a comment
There was a problem hiding this comment.
yeesh, good find. Any idea if this is true for the versions of android E-M supports?
| // Used to track if runtime is initialized. | ||
| FALSE_RUNTIME_GUARD(envoy_reloadable_features_runtime_initialized); | ||
| // TODO(mattklein123): Flip this to true and/or remove completely once verified by Envoy Mobile. | ||
| FALSE_RUNTIME_GUARD(envoy_reloadable_features_android_always_use_v6); |
There was a problem hiding this comment.
Also please unit test, or add unit tests to the TODO here if the timing is too tight.
There was a problem hiding this comment.
Do you have a suggestion of how to unit test this in this repo? This is all behind an android only ifdef.
There was a problem hiding this comment.
random drive by comment (ignore me if this doesnt make sense) can you make this:
#if defined(__ANDROID_API__) || defined(ENVOY_FORCE_ANDROID)
and add a bazel defines to test it?
if you want to resuse this you can wrap it with a constexpr bool function and reuse it in the codebase.
There was a problem hiding this comment.
I think I would prefer to not have a build flag for it since that will be harder to test. I think Alyssa's suggestion is good to just refactor it and add a unit test. I can do that but will do it as a follow up.
I haven't looked back through the Android history. It's true on main branch. I can take a look through previous versions of someone can tell me which versions to look back to. |
I looked and this applies all the way back to Android 6: https://cs.android.com/android/platform/superproject/+/android-6.0.1_r81:libcore/luni/src/main/native/libcore_io_Posix.cpp;l=91-128 |
|
Give connect method a boolean argument which defaults to forceV6ForAndroid() and explicitly set the boolean in test? Otherwise test upstream for E-M on android only CI? Again I'm fine with TODO but I think it's possible to test with a little refactor work. |
Yes my assumption is this will be implicitly tested in upstream EM CI, but yeah, let me add a TODO for unit testing this if this solution holds. |
alyssawilk
left a comment
There was a problem hiding this comment.
I'm not super confident of the change but as it's off by default and y'all are testing it I'm totally fine letting you folks figure out if there are corner cases missed :-) Good luck!
Description: Bumping upstream Envoy sha so that it includes recent changes that allow us to force IPv6 use on Android. The Envoy sha that we use in this PR is NOT from Envoy main. The idea is to pick up only @mattklein123's change from envoyproxy/envoy#21803 without any other changes. We are going to move back to Envoy main later this week. Risk Level: Low, disabled by default Testing: Manual, passed Docs Changes: N/A Release Notes: N/A Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Matt Klein <mklein@lyft.com> Signed-off-by: Amila Senadheera <amila.15@cse.mrt.ac.lk>
Description: Bumping upstream Envoy sha so that it includes recent changes that allow us to force IPv6 use on Android. The Envoy sha that we use in this PR is NOT from Envoy main. The idea is to pick up only @mattklein123's change from envoyproxy/envoy#21803 without any other changes. We are going to move back to Envoy main later this week. Risk Level: Low, disabled by default Testing: Manual, passed Docs Changes: N/A Release Notes: N/A Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Description: Forcing the use of IPv6 socket addresses is required to make Envoy Mobile work with some carriers when running on an Android device. The option was introduced upstream in envoyproxy/envoy#21803. Risk Level: Low, enabled a well tested option. Testing: Manual, launched the example app Docs Changes: Updated Release Notes: Updated Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
Description: Forcing the use of IPv6 socket addresses is required to make Envoy Mobile work with some carriers when running on an Android device. The option was introduced upstream in envoyproxy/envoy#21803. Risk Level: Low, enabled a well tested option. Testing: Manual, launched the example app Docs Changes: Updated Release Notes: Updated Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com> Signed-off-by: Chidera Olibie <colibie@google.com>
Description: Bumping upstream Envoy sha so that it includes recent changes that allow us to force IPv6 use on Android. The Envoy sha that we use in this PR is NOT from Envoy main. The idea is to pick up only @mattklein123's change from #21803 without any other changes. We are going to move back to Envoy main later this week. Risk Level: Low, disabled by default Testing: Manual, passed Docs Changes: N/A Release Notes: N/A Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
Description: Forcing the use of IPv6 socket addresses is required to make Envoy Mobile work with some carriers when running on an Android device. The option was introduced upstream in #21803. Risk Level: Low, enabled a well tested option. Testing: Manual, launched the example app Docs Changes: Updated Release Notes: Updated Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
Investigation shows that Android always uses IPv6 dual stack sockets. There is a chance that some long tail connectivity issues are related to this. This change adds a runtime guard (applicable to Android only) which will force use of IPv6 sockets and translate IPv4 addresses to mapped IPv6 addresses upon connection. This is the same as what is done for Java platform sockets.
Risk Level: None, runtime guarded to false on Android.
Testing: No possible tests here. EM will provide testing.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: Android only
Runtime guard: envoy.reloadable_features.android_always_use_v6 (default false)