The TCP CLOSE_WAIT Leak: Why Application Restarts Left Thousands of Sockets Hanging
When a remote peer closes a TCP connection, the OS kernel acknowledges the FIN and leaves the local socket in CLOSE_WAIT until the application closes its file descriptor. How missed EOF checks and unclosed HTTP client bodies exhaust system ulimits.