From 1daf3e7bd70491f763d45905bcf43ffb1b95426e Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sun, 13 Dec 2020 16:16:14 -0600 Subject: [PATCH] remove link.go block on oldIntf if we already have a connection to the same node, this spams connections, so it's not a good long-term fix if that's where the goroutine leak is --- src/yggdrasil/link.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/yggdrasil/link.go b/src/yggdrasil/link.go index 779c435..63c9a30 100644 --- a/src/yggdrasil/link.go +++ b/src/yggdrasil/link.go @@ -252,16 +252,12 @@ func (intf *link) handler() error { intf.info.box = meta.box intf.info.sig = meta.sig intf.links.mutex.Lock() - if oldIntf, isIn := intf.links.links[intf.info]; isIn { + if _, isIn := intf.links.links[intf.info]; isIn { intf.links.mutex.Unlock() // FIXME we should really return an error and let the caller block instead // That lets them do things like close connections on its own, avoid printing a connection message in the first place, etc. intf.links.core.log.Debugln("DEBUG: found existing interface for", intf.name) intf.msgIO.close() - if !intf.incoming { - // Block outgoing connection attempts until the existing connection closes - <-oldIntf.closed - } return nil } else { intf.closed = make(chan struct{})