-
Notifications
You must be signed in to change notification settings - Fork 236
refactor(iroh, iroh-relay)!: Do reconnection in ActiveRelayActor #3058
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This moves the reconnection logic ingo ActiveRelayActor instead of doing this in the RelayActor. The logic itself is not really changed. This does simplify things a fair bit though, it is a lot easier to do this in one place where all the state needs to be. In the grand scheme of things this moves "logical" control over the relay Client entirely into the ActiveRelayActor. Some small side effects: - The ActiveRelayMessage::Ping and ActiveRelayMessage::GetLocalAddr messages are no longer needed. Though I decided to keep the latter for testing purposes. - ActiveRelayMessage::NotePreferred has been rename to SetHomeRelay. Since the ActiveRelayActor now reconnects to relays on its own it needs to keep track of whether it is the home relay itself as well. - The duplicate ping task tracking in the RelayActor is removed. This is still not ideal in the ActiveRelayActor because it still blocks this actor. But that's no regression and to be addressed when the relay Client is no longer an actor. - RelayActor::close_and_reconnect_relay and RelayActor::send_to_active_relay are no longer needed. Because we await all the ActiveRelayActor tasks already we do not need to manually track them in case they need to be closed. - The ClientBuilder was no longer using is_preferred, so remove this.
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3058/docs/iroh/ Last updated: 2024-12-18T08:10:07Z |
dignifiedquire
approved these changes
Dec 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This moves the reconnection logic ingo ActiveRelayActor instead of
doing this in the RelayActor. The logic itself is not really changed.
This does simplify things a fair bit though, it is a lot easier to do
this in one place where all the state needs to be.
In the grand scheme of things this moves "logical" control over the
relay Client entirely into the ActiveRelayActor.
Some small side effects:
The ActiveRelayMessage::Ping and ActiveRelayMessage::GetLocalAddr
messages are no longer needed. Though I decided to keep the latter
for testing purposes.
ActiveRelayMessage::NotePreferred has been rename to SetHomeRelay.
Since the ActiveRelayActor now reconnects to relays on its own it
needs to keep track of whether it is the home relay itself as well.
The duplicate ping task tracking in the RelayActor is removed. This
is still not ideal in the ActiveRelayActor because it still blocks
this actor. But that's no regression and to be addressed when the
relay Client is no longer an actor.
RelayActor::close_and_reconnect_relay and
RelayActor::send_to_active_relay are no longer needed. Because we
await all the ActiveRelayActor tasks already we do not need to
manually track them in case they need to be closed.
The ClientBuilder was no longer using is_preferred, so remove this.
Breaking Changes
iroh-relay
ClientBuilder::is_preferred
no longer exists. Set the preference once the client exists instead.Notes & open questions
Change checklist