iroh icon indicating copy to clipboard operation
iroh copied to clipboard

Add timeouts to discovery

Open ramfox opened this issue 1 year ago • 2 comments

Discovery currently works quickly because our current DNS setup works well. But in theory, especially if someone writes a distributed version of discovery, this can be very slow. In the IPFS paradigm, this also often led to confusion—am I not connecting because the address I received from Discovery did not work, OR did Discovery still not respond?

We should ensure we have a reasonable timeout for discovery.

ramfox avatar May 23 '24 18:05 ramfox

This uses the default timeout in hickory, which is 5seconds. After retries in practice this is about 10seconds total

divagant-martian avatar May 23 '24 19:05 divagant-martian

We have timeouts in our implementation of the discovery trait, but we should include timeouts in our DiscoveryTask (which spawns and runs discovery) so that if other implementations of Discovery don't have timeouts, we have an escape hatch.

ramfox avatar May 23 '24 20:05 ramfox