Skip to content

Conversation

@matheus23
Copy link
Member

@matheus23 matheus23 commented Nov 20, 2025

Description

  • Removes guarded_channel.rs
  • Instead, uses normal mpsc channels, and once it closes them, collects all messages that were missed before the channel was closed, sends them back to the RemoteMap, which will immediately spawn a new RemoteStateActor in case it missed some messages during shutdown.
  • Spawns the RemoteStateActor in a JoinSet that's held in a Mutex inside the RemoteMap (effectively owned by the magic socket).

Notes & open questions

I think it's good to look at this right now, but some considerations/TODOs:

  • I don't like the mutex around the JoinSet in RemoteMap. Maybe only the magicsock::Actor should own the JoinSet, and the RemoteMap shouldn't actually store it itself.
  • I'm not sure if draining all "initial messages" in RemoteStateActor::run is the right way to do this.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.

Frando and others added 10 commits November 18, 2025 12:12
…send_datagram` (#3678)

Intended for merging into #3676

- Makes `idle_timeout` always be a `time::Sleep` that is `.reset` once
there is any activity. I find this much easier to reason about.
- Fixes a bug where `handle_msg_send_datagram` short-circuits when
sending on one path fails. Instead, it should *try* all paths, even if
some of them fail.
@matheus23 matheus23 self-assigned this Nov 20, 2025
@n0bot n0bot bot added this to iroh Nov 20, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Nov 20, 2025
@matheus23 matheus23 changed the base branch from feat-multipath to Frando/mp-fix-remote-state-actor-loop November 20, 2025 09:09
@matheus23 matheus23 force-pushed the matheus23/no-guarded-channel branch from 5c66034 to de05f27 Compare November 20, 2025 09:16
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3681/docs/iroh/

Last updated: 2025-11-20T10:41:01Z

@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 71bec76

@matheus23 matheus23 force-pushed the matheus23/no-guarded-channel branch from de05f27 to 4c4d11d Compare November 20, 2025 10:14
@matheus23 matheus23 marked this pull request as ready for review November 20, 2025 10:40
@matheus23 matheus23 marked this pull request as draft November 20, 2025 13:58
@matheus23
Copy link
Member Author

matheus23 commented Nov 20, 2025

This PR has the problem that we only run the remove_closed_remote_state_actors fn every 60s.

Also: The start_remote_actor fn is called from two places and might become racy.

Base automatically changed from Frando/mp-fix-remote-state-actor-loop to feat-multipath November 20, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

3 participants