-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
holepunch: race condition with identifyWait #2163
Comments
Is that a race condition? The |
I think it doesn't. IdentifyWait assumes the Connected call is completed before calling identifyWait. The entry is added here |
the relevant identifyWait line is this. |
Can you explain how things go wrong when this race condition is triggered? |
we will skip this block where we try to direct dial before hole punch |
Currently holepunch calls hs.ids.IdentifyWait(conn) inside the netNotifee.Connected call.
But IdentifyWait requires netNotifee.Connected call to identify to be completed.
https://github.com/libp2p/go-libp2p/blob/master/p2p/protocol/holepunch/holepuncher.go#L262
Swarm doesn't guarantee any ordering on notifcations. The notifees are obtained from map keys.
The text was updated successfully, but these errors were encountered: