Skip to content

Commit 32a4c54

Browse files
committed
Restore a warning about low FD limits
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.
1 parent c9c1a48 commit 32a4c54

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,8 @@ start_fhc() ->
16611661
ok = rabbit_sup:start_restartable_child(
16621662
file_handle_cache,
16631663
[fun(_) -> ok end, fun(_) -> ok end]),
1664-
ensure_working_fhc().
1664+
ensure_working_fhc(),
1665+
maybe_warn_low_fd_limit().
16651666

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

1705+
maybe_warn_low_fd_limit() ->
1706+
case file_handle_cache:ulimit() of
1707+
%% unknown is included as atom() > integer().
1708+
L when L > 1024 ->
1709+
ok;
1710+
L ->
1711+
rabbit_log:warning("Available file handles: ~tp. "
1712+
"Please consider increasing system limits", [L])
1713+
end.
1714+
17041715
%% Any configuration that
17051716
%% 1. is not allowed to change while RabbitMQ is running, and
17061717
%% 2. is read often

0 commit comments

Comments
 (0)