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

fix(enginenetx): stabilize happy eyeballs algorithm #1301

Merged
merged 3 commits into from
Sep 25, 2023

Conversation

bassosimone
Copy link
Contributor

  • Use 1s as the base delay (which leads to simpler computations)

  • Acknowledge that with very large indexes we still need to produce reasonable positive values, while the current algorithm breaks for indexes large than 63

  • Acknowledge that, after incrementing exponentially for a while, it makes sense to continue in a flat fashion, where we increment linearly, while the current algorithm was aiming to always return 30s, which means several attempts would actually run in parallel

  • Acknowledge that we should use the same zero for all timings rather than having a goroutine dependent zero

  • Acknowledge that for now we don't need to mock time.Now

Part of ooni/probe#2531

The current algorithm is broken in that, after doubling the delay for
a while (a) we could overflow if index is too big and (b) we end up
scheduling all attempts 30 seconds after the beginning.

Rather, we should switch to increasingly the delay linearly after we
have reached a given cutoff and we should not use an algorithm that
depends on the number be small to avoid overflow.

Part of ooni/probe#2531
@bassosimone bassosimone merged commit c5a2784 into master Sep 25, 2023
8 checks passed
@bassosimone bassosimone deleted the issue/2531-small branch September 25, 2023 21:36
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
* Use 1s as the base delay (which leads to simpler computations)

* Acknowledge that with very large indexes we still need to produce
reasonable positive values, while the current algorithm breaks for
indexes large than `63`

* Acknowledge that, after incrementing exponentially for a while, it
makes sense to continue in a flat fashion, where we increment linearly,
while the current algorithm was aiming to always return 30s, which means
several attempts would actually run in parallel

* Acknowledge that we should use the same zero for all timings rather
than having a goroutine dependent zero

* Acknowledge that for now we don't need to mock `time.Now`

Part of ooni/probe#2531
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.

1 participant