summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2019-11-13 14:27:46 -0800
committergVisor bot <gvisor-bot@google.com>2019-11-13 14:40:08 -0800
commit6dd4c9ee74828b27cd12ea343756f5625bae683c (patch)
tree6fbc226b5738bbf5270a4e834aae153463a4c3a2
parent683e8798ab4c2bde60f067563eef0cf06dc9bda5 (diff)
Fix flaky behaviour during S/R.
PiperOrigin-RevId: 280280156
-rw-r--r--pkg/tcpip/transport/tcp/connect.go4
1 files changed, 3 insertions, 1 deletions
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
}