Fix flaky behaviour during S/R.

PiperOrigin-RevId: 280280156
This commit is contained in:
Bhasker Hariharan
2019-11-13 14:40:08 -08:00
committed by gVisor bot
parent 683e8798ab
commit 6dd4c9ee74
+3 -1
View File
@@ -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
}