summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-11-04 22:44:48 -0800
committergVisor bot <gvisor-bot@google.com>2020-11-04 22:46:51 -0800
commit771e9ce8e18021fc8015c77c67e57f66ff93ea10 (patch)
tree1f198b1aa8ce220d52bee7021da88a19577fddb4 /pkg
parente29972ec04f96fa9c560f864113599ce313e1240 (diff)
Unlock tcp endpoint mutex before blocking forever.
This was occasionally causing tests to get stuck due to races with the save process, during which the same mutex is acquired. PiperOrigin-RevId: 340789616
Diffstat (limited to 'pkg')
-rw-r--r--pkg/tcpip/transport/tcp/connect.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go
index f5f7be195..c890e2326 100644
--- a/pkg/tcpip/transport/tcp/connect.go
+++ b/pkg/tcpip/transport/tcp/connect.go
@@ -1370,7 +1370,9 @@ func (e *endpoint) protocolMainLoop(handshake bool, wakerInitDone chan<- struct{
drained := e.drainDone != nil
if drained {
close(e.drainDone)
+ e.mu.Unlock()
<-e.undrain
+ e.mu.Lock()
}
// Set up the functions that will be called when the main protocol loop