gvisor/pkg
Bhasker Hariharan ae26b2c425 Fixes to TCP listen behavior.
Netstack listen loop can get stuck if cookies are in-use and the app is slow to
accept incoming connections. Further we continue to complete handshake for a
connection even if the backlog is full. This creates a problem when a lots of
connections come in rapidly and we end up with lots of completed connections
just hanging around to be delivered.

These fixes change netstack behaviour to mirror what linux does as described
here in the following article

http://veithen.io/2014/01/01/how-tcp-backlog-works-in-linux.html

Now when cookies are not in-use Netstack will silently drop the ACK to a SYN-ACK
and not complete the handshake if the backlog is full.  This will result in the
connection staying in a half-complete state. Eventually the sender will
retransmit the ACK and if backlog has space we will transition to a connected
state and deliver the endpoint.

Similarly when cookies are in use we do not try and create an endpoint unless
there is space in the accept queue to accept the newly created endpoint. If
there is no space then we again silently drop the ACK as we can just recreate it
when the ACK is retransmitted by the peer.

We also now use the backlog to cap the size of the SYN-RCVD queue for a given
endpoint. So at any time there can be N connections in the backlog and N in a
SYN-RCVD state if the application is not accepting connections. Any new SYNs
will be dropped.

This CL also fixes another small bug where we mark a new endpoint which has not
completed handshake as connected. We should wait till handshake successfully
completes before marking it connected.

Updates #236

PiperOrigin-RevId: 250717817
2019-05-30 12:08:41 -07:00
..
abi Wrap comments and reword in common present tense 2019-05-24 13:23:53 -07:00
amutex gvisor: interrupt the sendfile system call if a task has been interrupted 2019-05-23 23:21:13 -07:00
atomicbitops Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
binary Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
bits Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
bpf Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
compressio Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
control Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
cpuid Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
eventchannel Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
fd Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
fdnotifier Automated rollback of changelist 247964961 2019-05-15 14:58:40 -07:00
gate Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
ilist Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
linewriter Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
log Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
metric Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
p9 Forward named pipe creation to the gofer 2019-05-20 16:53:08 -07:00
rand Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
refs Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
seccomp Add arm64 support to pkg/seccomp 2019-05-03 22:03:59 -07:00
secio Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
segment Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
sentry Fixes to TCP listen behavior. 2019-05-30 12:08:41 -07:00
sleep Fix the signature for gopark. 2019-05-22 18:57:15 -07:00
state Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
syserr Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
syserror Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
tcpip Fixes to TCP listen behavior. 2019-05-30 12:08:41 -07:00
tmutex Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
unet Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
urpc Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
waiter Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00