Marten Seemann
Marten Seemann
Notes after syncing with @Stebalien: * The dial worker loop currently only cares about addresses we’re _dialing_, not incoming connections. Hole punched connections are incoming connections though, so we might...
We should also see if there are any test cases that are particularly slow. This is not a replacement for optimizing our CI setup, but it might help nonetheless. I...
These are all the tests taking longer than 0.5s (unfortunately, without the package names). The number behind the test name is the duration in seconds. ``` TestConstraintsCleanup,0.5 TestResolutionMisaligned,0.51 TestTcpTransport/github.com/libp2p/go-libp2p/p2p/transport/testsuite.SubtestStreamOpenStress#01,0.56 TestFuzzManyPeers,0.57...
https://github.com/libp2p/go-libp2p/runs/7153635906?check_suite_focus=true ``` === RUN TestObsAddrSet 2022-07-01T16:37:09.347Z DEBUG net/identify identify/obsaddr.go:397 added own observed listen addr {"observed": "/ip4/1.2.3.4/tcp/1231"} 2022-07-01T16:37:09.347Z DEBUG net/identify identify/id.go:408 /ipfs/id/1.0.0 sent message to Qmaj3Hr7dGd4MJGqPSFGvXDhvJZzyHdFFDpX3SEvyPHDdF /ip4/127.0.0.1/tcp/10086 2022-07-01T16:37:09.347Z DEBUG net/identify identify/id.go:440...
The reason is most likely that CI is really slow and executing the dials more than 200 (400?) ms apart, which is why rate limiting doesn't kick in.
``` === RUN TestAutoNATServiceDialRateLimiter svc_test.go:112: AutoNAT error: dial failed (E_DIAL_ERROR) --- FAIL: TestAutoNATServiceDialRateLimiter (0.37s)
Failed run: https://github.com/libp2p/go-libp2p/runs/6681155403?check_suite_focus=true
And it's racy as well: ``` === RUN TestLargeIdentifyMessage ================== WARNING: DATA RACE Read at 0x000002004798 by goroutine 143: github.com/libp2p/go-libp2p/p2p/protocol/identify.(*idService).consumeMessage() /home/runner/work/go-libp2p/go-libp2p/p2p/protocol/identify/id.go:621 +0x2d6 github.com/libp2p/go-libp2p/p2p/protocol/identify.(*idService).handleIdentifyResponse() /home/runner/work/go-libp2p/go-libp2p/p2p/protocol/identify/id.go:455 +0x8a9 github.com/libp2p/go-libp2p/p2p/protocol/identify.(*idService).pushHandler() /home/runner/work/go-libp2p/go-libp2p/p2p/protocol/identify/id_push.go:16 +0x4d github.com/libp2p/go-libp2p/p2p/protocol/identify.(*idService).pushHandler-fm() /home/runner/work/go-libp2p/go-libp2p/p2p/protocol/identify/id_push.go:15...
That's not expected, and might very well be a bug. Are you still using the old mDNS in parallel? We might have another issue with one of the two implementations...
To clarify, this proposal only applies to `/dnsX` addresses. The host still needs to resolve `/dnsaddr`s. Ideally, we find a way to that concurrently with other dials.