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: start new connections independently of connection failures #5927

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Aug 28, 2024

With current implementation
every time connection fails
we take the next delay from delays iterator.
In the worst case first 4 DNS results
immediately refuse connection
and we start fifth connection attempt
with 1 year timeout,
effectively continuing all remaining
connection attempts without concurrency.

With new implementation
new connection attempts are
added to connection_attempt_set
independently of connection failures
and after 10 seconds
we always end up with five
parallel connection attempts
as long as there are enough IP addresses.

@link2xt
Copy link
Collaborator Author

link2xt commented Aug 28, 2024

This is a follow-up to #5915. #5915 initially had similar implementation, but in second commit in the PR @Hocuri attempted to simplify the logic with using timeout and no tokio::select!. This PR reverts the simplification.

With current implementation
every time connection fails
we take the next delay from `delays` iterator.
In the worst case first 4 DNS results
immediately refuse connection
and we start fifth connection attempt
with 1 year timeout,
effectively continuing all remaining
connection attempts without concurrency.

With new implementation
new connection attempts are
added to `connection_attempt_set`
independently of connection failures
and after 10 seconds
we always end up with five
parallel connection attempts
as long as there are enough IP addresses.
@link2xt link2xt merged commit f01514d into main Aug 29, 2024
37 checks passed
@link2xt link2xt deleted the link2xt/fix-delay-set branch August 29, 2024 13:24
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