Skip to content
Snippets Groups Projects
Commit 7b87d90c authored by Marc van der Wal's avatar Marc van der Wal
Browse files

TCP listener: avoid buildup of DOWN messages

TCP listeners run separate acceptor processes that they monitor. In the
happy path where a client connects, the acceptor process sends a message
to the parent, then exits.

That happy path causes two messages to be sent to the parent process: a
tcp_connect message and a DOWN message. But the DOWN message was never
handled, causing the message queue of the TCP listener to build up and
grow unbounded.

The fix consists of demonitoring the process that just gave the TCP
listener a socket. For good measure, we give the :flush option, which
removes a possible DOWN message from the caller’s message queue. This
should be enough to fix the message queue growth problem.

Ideally, this entire module could use an overhaul. The whole thing is
hacky because of the need to call :procket.open and :procket.close/1
manually when starting or stopping a listener. There ought to be a
smarter way.
parent 7d2e4f7e
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment