828d0b9984
Go will, by default, set tcp keep alives on sockets. But the kernel does not send keep alives to sockets that have a non-empty send queue. That can cause connections that hang forever. So we set TCP_USER_TIMEOUT on all of the sockets as well. That option will close any connection that has not received an ack for any sent data (keep alive or otherwise) in the configured time period. This places an upper bound on the amount of time a socket can be stuck due to a client not acknowleding data. See https://blog.cloudflare.com/when-tcp-sockets-refuse-to-die/ for more information on what these options do and how they interact. Additionally, make sure that we close every connection coming from the listeners by wrapping them in a type with a finalizer that closes the connection, much like the os package does for file handles. It monitors if a connection was closed due to a finalizer so that we can go and look for the bug if we ever see a non-zero value. Change-Id: Idc6c0564224b8dc2e4c9d769e80374ed1fe8cce0 |
||
---|---|---|
.. | ||
auth | ||
cfgstruct | ||
listenmux | ||
macaroon | ||
miniogw | ||
process | ||
revocation | ||
server | ||
storj | ||
telemetry |