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): Trigger netcheck on a magicsock rebind #2042

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Feb 22, 2024

Description

This incorporates two fixes:

  • The .set_preferred_port() function was completely ignoring the passed port. This is now plugged through to the rebind. Nobody was using this function before though. I'm not so sure how useful it is.

  • When rebinding the locally bound sockets change. This means we have to do a new netcheck as otherwise we won't know about our new endpoints until a new netcheck runs on it's regular schedule.

Notes & open questions

This is kind of split off from #2041 because it ends up doing unrelated fixes just for an improvement to tests.

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

flub added 2 commits February 22, 2024 14:47
The API to retrieve local endpoints was split in two between the
current endpoints and updates to it.  This was very hard to use right
without any race conditions.

This replaces it with a single API which returns a stream.  This is a
little bit wordier to use if you just need the current local item, but
much harder to misuse.
This incorporates two fixes:

- The .set_preferred_port() function was completely ignoring the
  passed port.  This is now plugged through to the rebind.  Nobody was
  using this function before though.  I'm not so sure how useful it
  is.

- When rebinding the locally bound sockets change.  This means we have
  to do a new netcheck as otherwise we won't know about our new
  endpoints until a new netcheck runs on it's regular schedule.
@flub flub requested a review from dignifiedquire February 22, 2024 15:52
Base automatically changed from flub/api-local-endpoints to main February 22, 2024 16:22
@flub flub added this pull request to the merge queue Feb 22, 2024
Merged via the queue into main with commit 890d019 Feb 22, 2024
19 checks passed
@flub flub deleted the flub/netcheck-on-rebind branch February 22, 2024 17:23
fubuloubu pushed a commit to ApeWorX/iroh that referenced this pull request Feb 27, 2024
## Description

This incorporates two fixes:

- The .set_preferred_port() function was completely ignoring the passed
port. This is now plugged through to the rebind. Nobody was using this
function before though. I'm not so sure how useful it is.

- When rebinding the locally bound sockets change. This means we have to
do a new netcheck as otherwise we won't know about our new endpoints
until a new netcheck runs on it's regular schedule.

## Notes & open questions

This is kind of split off from n0-computer#2041 because it ends up doing unrelated
fixes just for an improvement to tests.

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [x] Tests if relevant.
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.

2 participants