envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Happy Eyeball routines should not call sortAddress() in data path during creating connection

Open yanjunxiang-google opened this issue 1 year ago • 4 comments

Title: Happy Eyeball routines should not call sortAddress() in data path during creating connection

Description: Currently happy eyeball routine is calling sortAddress() in data. path when creating connection:

https://github.com/envoyproxy/envoy/blob/c9fb17a6fabd1d2030ce8f5192780e947a335e01/source/common/upstream/upstream_impl.cc#L531

https://github.com/envoyproxy/envoy/blob/c9fb17a6fabd1d2030ce8f5192780e947a335e01/source/common/network/happy_eyeballs_connection_impl.cc#L21

https://github.com/envoyproxy/envoy/blob/c9fb17a6fabd1d2030ce8f5192780e947a335e01/source/common/network/happy_eyeballs_connection_impl.cc#L103

If the address vector is relatively big, and rarely changes, which is normal, then this is very inefficient.

The code should try to sort the address in control plane, like DNS refreshing, when new addresses are added to the host, and store that sorted result in host. And data plane just use that sorted result.

yanjunxiang-google avatar Mar 14 '24 21:03 yanjunxiang-google

/assign @RyanTheOptimist @yanavlasov @adisuissa

yanjunxiang-google avatar Mar 14 '24 21:03 yanjunxiang-google

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 14 '24 00:04 github-actions[bot]

/wait

yanjunxiang-google avatar Apr 15 '24 16:04 yanjunxiang-google

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 15 '24 20:05 github-actions[bot]