← BYTES
Unix IPC·Starter·Ref: 15.1.29

Is a large, steadily growing number of sockets stuck in CLOSE_WAIT a sign of a bug?

Have a question about this video? Mention reference 15.1.29 when you contact us.

a.Usually yes -- unlike TIME_WAIT, CLOSE_WAIT has no automatic kernel timer; a socket stays there until the LOCAL application explicitly calls close(), so a growing pile of them points at application code that isn't closing sockets it should
b.No -- CLOSE_WAIT always clears itself automatically after a short timeout, just like TIME_WAIT
c.Yes, but only on Windows systems
d.No -- it simply means the network is slow
Unlike TIME_WAIT (which the kernel automatically clears after a fixed window), nothing forces a socket out of CLOSE_WAIT except the local application actually calling close() on it. A steadily growing CLOSE_WAIT count is a classic symptom of an application bug -- usually code that received EOF from the peer but never got around to closing its own side, leaking file descriptors over time.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES15129#UnixIPC