iroh icon indicating copy to clipboard operation
iroh copied to clipboard

Avoid lagging of path events

Open flub opened this issue 1 month ago • 0 comments

This is unlikely to be needed for 1.0.

But there's a TODO in the code so creating this issue already for visibility. And someone might disagree with how important this is.

Basically we get events from tokio via a tokio broadcast. This could lag if an actor does not keep up. At which point the state that the EndpointStateActor keeps is out of sync and it kind of makes the entire actor in trouble as its logic assumes it knows what things look like.

The solution to this is to update the Quinn APIs to be more Quinn-like (Quinn doesn't have any "event" producing APIs in the quinn crate) and return distinct futures for each kind of event you're waiting for. The actor would then much more actively have to register for those futures and consume then in MergeUnbounded streams. But it would mean no value can be lost.

I don't expect this to be too crazy a refactor. Updating the Quinn APIs and then a bunch of mechanical stuff to update the iroh side.

flub avatar Nov 10 '25 17:11 flub