From 6dd4c9ee74828b27cd12ea343756f5625bae683c Mon Sep 17 00:00:00 2001 From: Bhasker Hariharan Date: Wed, 13 Nov 2019 14:27:46 -0800 Subject: Fix flaky behaviour during S/R. PiperOrigin-RevId: 280280156 --- pkg/tcpip/transport/tcp/connect.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/tcpip/transport/tcp') diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go index a114c06c1..be066d877 100644 --- a/pkg/tcpip/transport/tcp/connect.go +++ b/pkg/tcpip/transport/tcp/connect.go @@ -1229,7 +1229,9 @@ func (e *endpoint) protocolMainLoop(handshake bool) *tcpip.Error { return err } } - if e.state != StateError { + if e.state != StateClose && e.state != StateError { + // Only block the worker if the endpoint + // is not in closed state or error state. close(e.drainDone) <-e.undrain } -- cgit v1.2.3