Skip to content

Commit

Permalink
Restore a warning about low FD limits
Browse files Browse the repository at this point in the history
The message has been tweaked; it isn't about FHC
or queues but about system limits only. The
ulimit() function can later be moved out of
FHC when FHC gets fully removed.
  • Loading branch information
lhoguin committed Jun 20, 2024
1 parent c9c1a48 commit 32a4c54
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion deps/rabbit/src/rabbit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,8 @@ start_fhc() ->
ok = rabbit_sup:start_restartable_child(
file_handle_cache,
[fun(_) -> ok end, fun(_) -> ok end]),
ensure_working_fhc().
ensure_working_fhc(),
maybe_warn_low_fd_limit().

ensure_working_fhc() ->
%% To test the file handle cache, we simply read a file we know it
Expand Down Expand Up @@ -1701,6 +1702,16 @@ ensure_working_fhc() ->
throw({ensure_working_fhc, {timeout, TestPid}})
end.

maybe_warn_low_fd_limit() ->
case file_handle_cache:ulimit() of
%% unknown is included as atom() > integer().
L when L > 1024 ->
ok;
L ->
rabbit_log:warning("Available file handles: ~tp. "
"Please consider increasing system limits", [L])
end.

%% Any configuration that
%% 1. is not allowed to change while RabbitMQ is running, and
%% 2. is read often
Expand Down

0 comments on commit 32a4c54

Please sign in to comment.