Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: in the swarm move Connectedness emit after releasing conns
go-libp2p-kad-dht now listen to both EvtPeerIdentificationCompleted and EvtPeerConnectednessChanged and EvtPeerIdentificationCompleted calls .ConnsToPeer inorder to do some filtering. However it happens that it deadlocks because if the swarm is trying to emit a EvtPeerConnectednessChanged while the subscriber is trying to process an EvtPeerIdentificationCompleted, the subscriber is stuck on s.conns.RLock() while the swarm wont release it before having sent EvtPeerConnectednessChanged. Deadlock ! I havn't confirmed this fixes my bug given this takes time to reproduce, I'll startup a new experiment soon.
- Loading branch information