summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/fsm.go')
-rw-r--r--server/fsm.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/fsm.go b/server/fsm.go
index d70d0f8b..0c3c2efb 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -325,7 +325,15 @@ func (fsm *FSM) connectLoop() error {
}
if err == nil {
- fsm.connCh <- conn
+ select {
+ case fsm.connCh <- conn:
+ default:
+ conn.Close()
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": fsm.pConf.Config.NeighborAddress,
+ }).Warn("active conn is closed to avoid being blocked")
+ }
} else {
log.WithFields(log.Fields{
"Topic": "Peer",