A server I work on went quiet after a burst of connections. It had not crashed, it logged nothing, and its connection gauge said 0, yet the process on the other end of its socket still held thousands of connections it believed were open. This is the story of finding why, and the one rule about edge-triggered notifications that I had only half applied.
The symptom
The server (C++, one event loop per thread, epoll) hands events to a second process over a Unix socket: a connection opened, a message arrived, a connection closed. After a load test of 5,000 browsers connecting at once and joining channels, about two runs in three ended with the server showing 0 connections while the other process still held thousands. The Close events had been created and queued. They never arrived.
No error, no log line, no crash.…