From 771e9ce8e18021fc8015c77c67e57f66ff93ea10 Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Wed, 4 Nov 2020 22:44:48 -0800 Subject: 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 --- pkg/tcpip/transport/tcp/connect.go | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3