Skip to content

Commit b14bb68

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 d222a36 commit b14bb68

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
@@ -1654,7 +1654,8 @@ start_fhc() ->
16541654
ok = rabbit_sup:start_restartable_child(
16551655
file_handle_cache,
16561656
[fun(_) -> ok end, fun(_) -> ok end]),
1657-
ensure_working_fhc().
1657+
ensure_working_fhc(),
1658+
maybe_warn_low_fd_limit().
16581659

16591660
ensure_working_fhc() ->
16601661
%% To test the file handle cache, we simply read a file we know it
@@ -1694,6 +1695,16 @@ ensure_working_fhc() ->
16941695
throw({ensure_working_fhc, {timeout, TestPid}})
16951696
end.
16961697

1698+
maybe_warn_low_fd_limit() ->
1699+
case file_handle_cache:ulimit() of
1700+
%% unknown is included as atom() > integer().
1701+
L when L > 1024 ->
1702+
ok;
1703+
L ->
1704+
rabbit_log:warning("Available file handles: ~tp. "
1705+
"Please consider increasing system limits", [L])
1706+
end.
1707+
16971708
%% Any configuration that
16981709
%% 1. is not allowed to change while RabbitMQ is running, and
16991710
%% 2. is read often

0 commit comments

Comments
 (0)