Closed veshij closed 5 months ago
We started seeing some rate of panics after we added periodic (*Torrent).KnownSwarm() call for debugging purposes. It looks like in a few other places operations with t.conns are processed while t.cl.rLock() is held, replicating the same behavior.
(*Torrent).KnownSwarm()
fatal error: concurrent map iteration and map write goroutine 86949826 [running]: github.com/anacrolix/torrent.(*Torrent).KnownSwarm(0xc00355a000) go/src/github.com/anacrolix/torrent/torrent.go:248 +0x17d ...
Good catch, thank you!
We started seeing some rate of panics after we added periodic
(*Torrent).KnownSwarm()
call for debugging purposes. It looks like in a few other places operations with t.conns are processed while t.cl.rLock() is held, replicating the same behavior.