go-perun
go-perun copied to clipboard
Improve race detection in endpoint registry
Location wire/net.EndpointRegistry
Problem Replacing a connection before it timed out on the other end will trigger the race detector, even if there is no race.
Proposal For each Endpoint, remember the time it was opened. During fullEndpoint.replace(), if !dialed (i.e., we have an incoming connection) and the previous endpoint is older than 5 seconds, do not perform the race check, and simply discard the old connection.