mesh
mesh copied to clipboard
encryptedTCPSender.Send() holds a lock over a TCP send
Lock is not released until the Send()
returns.
Taken together with #125 this means it can hold a lock forever.
Sender and receiver each maintain state including a sequence number, so if we unlock before calling Send()
it's possible that messages get out of order.
Seen at https://github.com/weaveworks/weave/issues/3762
I am now thinking this is not a bug, on the basis:
- there is one lock per outgoing socket
- the
Send()
on the socket will block all callers when the buffer is full
therefore it doesn't make any difference if we block earlier on the lock.