Skip to content

Commit 2482deb

Browse files
Don't await for error_logger handlers to initialise
It will never be started on OTP 21. The problem this piece of code originally was added to solve is not very relevant now that we use Lager. Arguably connection rate throttling should be enforced elsewhere, be it Ranch or a proxy/load balancer. In any case, this particular implementation worked around an error_logger issue that is no longer problematic for us, and eventually won't be problematic for the entire ecosystem because OTP 21 introduced a completely new logger. Cherry-picked per discussion with @dumbbell and @lukebakken. [#157964874] (cherry picked from commit a54b44f) (cherry picked from commit a210d82)
1 parent d48f77e commit 2482deb

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/rabbit_reader.erl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,6 @@
181181
start_link(HelperSup, Ref, Sock) ->
182182
Pid = proc_lib:spawn_link(?MODULE, init, [self(), HelperSup, Ref, Sock]),
183183

184-
%% In the event that somebody floods us with connections, the
185-
%% reader processes can spew log events at error_logger faster
186-
%% than it can keep up, causing its mailbox to grow unbounded
187-
%% until we eat all the memory available and crash. So here is a
188-
%% meaningless synchronous call to the underlying gen_event
189-
%% mechanism. When it returns the mailbox is drained, and we
190-
%% return to our caller to accept more connections.
191-
gen_event:which_handlers(error_logger),
192-
193184
{ok, Pid}.
194185

195186
shutdown(Pid, Explanation) ->

0 commit comments

Comments
 (0)