Closed whyrusleeping closed 3 years ago
The problem here is that https://github.com/ipfs/go-bitswap/blob/2b51297a0b68198b6c4bcacdd8868a6df8dcd182/network/connecteventmanager.go#L85 copies out the connection state under a read lock as a pointer.
We should either do the check under the read lock, or do what was probably intended which is to copy out the state instead of a pointer to the state.
Fix in #528. Interestingly, this isn't getting covered by tests:
Are we not receiving any messages after receiving the connect notification?
Ive been running estuary with the race checker on for the past day or so, and it turned up something in bitswap:
cc @mvdan who helped me set up the 'unlimited goroutine race checker'