peer: make PingManager disconnect call async
In this commit, we make all calls to disconnect after a ping/pong violation is detected in the `PingManager` async. We do this to avoid circular waiting that may occur if the disconnect call back ends up waiting on the peer goroutine to be torn down. If this happens, then the peer goroutine will be blocked on the ping manager fully tearing down, which is blocked on the peer disconnect succeeding. This is a similar class of issue we've delt with recently as pertains to the peer and the server: sync all back execution must not lead to a circular waiting loop. Fixes #8379
This commit is contained in:
2 files changed
+5
-2
No files matched your search
+1
-1
@@ -577,7 +577,7 @@ func NewBrontide(cfg Config) *Brontide {
|
||||
eStr := "pong response failure for %s: %v " +
|
||||
"-- disconnecting"
|
||||
p.log.Warnf(eStr, p, err)
|
||||
p.Disconnect(fmt.Errorf(eStr, p, err))
|
||||
go p.Disconnect(fmt.Errorf(eStr, p, err))
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user