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(iroh-net): avoid double connections to relays #2148

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented Apr 4, 2024

The self.connect call in Actor::recv_detail was racing to create a connection with an incoming actor message to do so.

This simplifies recv_detail and only attempts to do so if there is already a connection, which is the correct logic in the first place.

Closes #2144

The `self.connect` call in `Actor::recv_detail` was racing to create a connection with an incoming actor message to do so.

This simplifies `recv_detail` and only attempts to do so if there is already a connection, which is the correct logic in the first place.
Copy link
Contributor

@ramfox ramfox left a comment

Choose a reason for hiding this comment

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

lgtm

This has a "fundamental" change, in that we now immediately dial when we build a relay::http::Client, but this is probably a good thing. The way our code is set up, any ActiveRelay that we create is only created when we are trying to either immediately send content, or establish a connection with our home relay.

@dignifiedquire dignifiedquire added this pull request to the merge queue Apr 4, 2024
Merged via the queue into main with commit aa1cf66 Apr 4, 2024
20 checks passed
@dignifiedquire dignifiedquire deleted the fix-avoid-double-connect branch April 4, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

iroh-net: dual connection attempts to relay server
2 participants