storj/pkg
Jeff Wendling 828d0b9984 pkg/server: set TCP_USER_TIMEOUT and monitor leaked conns
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
2020-01-03 21:31:09 +00:00
..
auth common: separate repository 2019-12-27 14:11:15 +02:00
cfgstruct common: separate repository 2019-12-27 14:11:15 +02:00
listenmux pkg/listenmux: resolve deadlock in test 2019-09-20 21:16:59 +00:00
macaroon common: separate repository 2019-12-27 14:11:15 +02:00
miniogw uplink: move configs to cmd/uplink/cmd 2020-01-02 09:40:57 +00:00
process common: separate repository 2019-12-27 14:11:15 +02:00
revocation common: separate repository 2019-12-27 14:11:15 +02:00
server pkg/server: set TCP_USER_TIMEOUT and monitor leaked conns 2020-01-03 21:31:09 +00:00
storj common: separate repository 2019-12-27 14:11:15 +02:00
telemetry pkg/process: reduce noise in storj-sim (#2988) 2019-09-10 10:32:53 +03:00