Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUST-1994 Implement happy eyeballs for TCP connection #1183

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Aug 6, 2024

RUST-1994

This adapts the implementation from the happy-eyeballs crate rather than using it directly to preserve some stream initialization that didn't fit in that crate and better match our error handling.

Benchmarks are within noise:

  • pre-change: TEST: Run Command (cold start) -- Score: 0.197 MB/s, Median Iteration Time: 0.659s
  • post-change TEST: Run Command (cold start) -- Score: 0.189 MB/s, Median Iteration Time: 0.686s

The implementation here is a fairly minimal rendition of RFC 6555; it does not include:

  • stateful tracking of IPv6 failure,
  • reset on network re-initialization,
  • or any of the additions in RFC 8305.

@abr-egn abr-egn marked this pull request as ready for review August 6, 2024 20:15
Copy link
Contributor

@isabelatkinson isabelatkinson left a comment

Choose a reason for hiding this comment

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

changes LGTM! maybe hold off on merging til we get some feedback in #1170

let (mut left, mut right) = (left.into_iter(), right.into_iter());
while let Some(a) = left.next() {
out.push(a);
std::mem::swap(&mut left, &mut right);
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@abr-egn abr-egn merged commit 7e7986a into mongodb:main Aug 19, 2024
15 checks passed
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.

2 participants