From 6437caddf2afbe4b1864943618d5da4993eec93b Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 27 Feb 2015 15:02:30 +0000 Subject: [PATCH] Reworded comment --- router/connection.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/router/connection.go b/router/connection.go index 096f969b..1e4166e4 100644 --- a/router/connection.go +++ b/router/connection.go @@ -181,9 +181,11 @@ func (conn *LocalConnection) log(args ...interface{}) { log.Println(append(append([]interface{}{}, fmt.Sprintf("->[%s]:", conn.remote.Name)), args...)...) } -// Send directly - not via the Actor queryLoop. -// note that tcpSender is immutable and guaranteed to be set by the -// time anybody can get hold of a ref to the Connection +// Send directly, not via the Actor. If it goes via the Actor we can +// get a deadlock where LocalConnection is blocked talking to +// LocalPeer and LocalPeer is blocked trying send a ProtocolMsg via +// LocalConnection, and the channels are full in both directions so +// nothing can proceed. func (conn *LocalConnection) SendProtocolMsg(m ProtocolMsg) { if err := conn.sendProtocolMsg(m); err != nil { conn.Shutdown(err)