Improve MagicSock poll_ready behaviour
Author: flubCreated Aug 28, 2024Updated Sep 22, 2026
Labelsbugfeatc-iroh
Currently the iroh_net::magicsock::IoPoller will return Ready as soon as any of the channels (udp-ipv4, upd-ipv6 or relay) could send. This very easily results in Ready to be returned to eagerly: e.g. in a 1-1 transfer which is using udp-ipv4 only it would always return ready for the relay and udp-ipv6 thus never back off the poller.
We should improve the poller so that it does do this correctly. This may need more pollers as described in https://github.com/n0-computer/iroh/blob/f28bd27b87ee3e419835dce1fdeacbd0d895098d/iroh-net/src/magicsock.rs#L432-L445
Labelling as both a bug and a feature, because I don't think this behaviour is new since we use [email protected] but it still is not great.
Source: n0-computer/iroh