renproject / aw

A flexible P2P networking library for upgradable distributed systems.
MIT License
38 stars 18 forks source link

fix race condition #82

Closed ross-pure closed 3 years ago

ross-pure commented 3 years ago

This PR fixes a race condition in the transport. The problem is the when accepting a new connection, the connect function is called before it potentially needs to Bind to the remote. This leaves a window of opportunity where when calling Send it will think that it is connected even though there is no channel in the table. This will eventually lead to an error being returned at client.go:163 which bubbles up as a DPanic in gossip.go.

rahulghangas commented 3 years ago

LGTM