Skip to content

Commit

Permalink
Fix flaky behaviour during S/R.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 280280156
  • Loading branch information
hbhasker authored and gvisor-bot committed Nov 13, 2019
1 parent 683e879 commit 6dd4c9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/tcpip/transport/tcp/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6dd4c9e

Please sign in to comment.