diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2012-01-25 15:03:53 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-01-25 15:03:53 +0000 |
commit | 23dfb01030191c016185c113e741a635a9eb01dc (patch) | |
tree | 0af3306c984bba1eb3e8ceee69dc7e65bd244eb5 /src/rabbit_networking.erl | |
parent | ceb1c9a7aac2e7401f9e803569dceb9f37c9add0 (diff) | |
download | rabbitmq-server-23dfb01030191c016185c113e741a635a9eb01dc.tar.gz |
move error_logger 'flow control' into application code
since tcp_acceptor no longer does any per-connection logging itself
Diffstat (limited to 'src/rabbit_networking.erl')
-rw-r--r-- | src/rabbit_networking.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index 64318ac9..99bfb765 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -264,6 +264,16 @@ start_client(Sock, SockTransform) -> {ok, _Child, Reader} = supervisor:start_child(rabbit_tcp_client_sup, []), ok = rabbit_net:controlling_process(Sock, Reader), Reader ! {go, Sock, SockTransform}, + + %% In the event that somebody floods us with connections, the + %% reader processes can spew log events at error_logger faster + %% than it can keep up, causing its mailbox to grow unbounded + %% until we eat all the memory available and crash. So here is a + %% meaningless synchronous call to the underlying gen_event + %% mechanism. When it returns the mailbox is drained, and we + %% return to our caller to accept more connetions. + gen_event:which_handlers(error_logger), + Reader. start_client(Sock) -> |