You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(iroh): fix very slow initial connection establishment (#3434)
## Description
Fixes very slow (~1s) initial connection establishment
Also adds a test for initial connection delay.
Initial connection was *very* slow even with relays disabled and static
discovery. There was a fixed delay.
## Breaking Changes
None
## Notes & open questions
~~Question: not sure how we can turn this into a proper test without
making it super flaky, since it is a timing test. Maybe measure the
ratio between first and second round and have some very conservative
bounds?~~
Changed the test name and put the timings in the assertion. I think the
test is good to go as is. The ratio is extremely conservative, so it
should rarely flake out.
Note: I do 32 connections as an attempt to make the timings more
reliable, but strictly speaking it would also work with 1 connection.
```
thread 'endpoint::tests::initial_connection_time' panicked at iroh/src/endpoint.rs:3269:9:
First round: 32.230450542s, second round 0.063144708s
```
## Change checklist
<!-- Remove any that are not relevant. -->
- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
- [ ] List all breaking changes in the above "Breaking Changes" section.
- [ ] Open an issue or PR on any number0 repos that are affected by this
breaking change. Give guidance on how the updates should be handled or
do the actual updates themselves. The major ones are:
- [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc)
- [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip)
- [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs)
- [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe)
- [ ] [`sendme`](https://github.com/n0-computer/sendme)
---------
Co-authored-by: dignifiedquire <[email protected]>
0 commit comments