summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-05-21 13:59:08 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-05-21 13:59:08 +0100
commit6811a5cf781e5291d6732a0ce5c14c702e9d11cb (patch)
tree2bf05046670a30077b175a4a32e77835c5fe2bc5
parent2604ad8d6faa63be8628c2d8cb9b440504a5d1ce (diff)
parent30181bea93e69b1bfb1b3584c66bb0a11987cab1 (diff)
downloadrabbitmq-server-git-6811a5cf781e5291d6732a0ce5c14c702e9d11cb.tar.gz
Merging bug 22340 into default
-rw-r--r--src/tcp_acceptor.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tcp_acceptor.erl b/src/tcp_acceptor.erl
index 3b23daa5c1..cc4982c9cb 100644
--- a/src/tcp_acceptor.erl
+++ b/src/tcp_acceptor.erl
@@ -75,6 +75,13 @@ handle_info({inet_async, LSock, Ref, {ok, Sock}},
error_logger:info_msg("accepted TCP connection on ~s:~p from ~s:~p~n",
[inet_parse:ntoa(Address), Port,
inet_parse:ntoa(PeerAddress), PeerPort]),
+ %% In the event that somebody floods us with connections we can spew
+ %% the above message at error_logger faster than it can keep up.
+ %% So error_logger's mailbox grows unbounded until we eat all the
+ %% memory available and crash. So here's a meaningless synchronous call
+ %% to the underlying gen_event mechanism - when it returns the mailbox
+ %% is drained.
+ gen_event:which_handlers(error_logger),
%% handle
file_handle_cache:release_on_death(apply(M, F, A ++ [Sock]))
catch {inet_error, Reason} ->