Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swarm: duplicate tracking in dial worker loop doesn't work #2283

Closed
Tracked by #2237
marten-seemann opened this issue May 11, 2023 · 1 comment · Fixed by #2284
Closed
Tracked by #2237

swarm: duplicate tracking in dial worker loop doesn't work #2283

marten-seemann opened this issue May 11, 2023 · 1 comment · Fixed by #2284
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@marten-seemann
Copy link
Contributor

In the dial worker loop, we use maps of ma.Multiaddrs:

addrs map[ma.Multiaddr]struct{} // pending addr dials

and

pending map[ma.Multiaddr]*addrDial

This is incorrect, since ma.Multiaddr is (until we fix multiformats/go-multiaddr#198) an interface, and equality only checks equality of the pointer, not of the actual multiaddress. This has bitten us before, for example in #2247.

@marten-seemann marten-seemann added the kind/bug A bug in existing code (including security flaws) label May 11, 2023
@marten-seemann marten-seemann mentioned this issue May 11, 2023
27 tasks
@marten-seemann
Copy link
Contributor Author

The impact of this is that we dial the same multiaddr multiple times. On TCP, due to reuseport, this should lead to failed dial right away, whereas on QUIC, we'd actually dial twice. I instrumented my Kubo node, and this happens from time to time.

This probably doesn't warrant another patch release, but we should include a fix in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant