Skip to content

Commit

Permalink
rabbitmq-diagnostics status: drop date-based support status field
Browse files Browse the repository at this point in the history
As of [1], this field has become irrelevant or even
misleading.

1. https://www.rabbitmq.com/blog/2024/05/31/new-community-support-policy

(cherry picked from commit 41e5d38)
(cherry picked from commit 53c67ce)

# Conflicts:
#	deps/rabbit/src/rabbit.erl
#	deps/rabbit/src/rabbit_release_series.erl
  • Loading branch information
michaelklishin authored and mergify[bot] committed Jun 6, 2024
1 parent 951fa66 commit f33bf80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
12 changes: 5 additions & 7 deletions deps/rabbit/src/rabbit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,13 @@ maybe_print_boot_progress(true, IterationsLeft) ->
status() ->
Version = base_product_version(),
[CryptoLibInfo] = crypto:info_lib(),
SeriesSupportStatus = rabbit_release_series:readable_support_status(),
S1 = [{pid, list_to_integer(os:getpid())},
%% The timeout value used is twice that of gen_server:call/2.
{running_applications, rabbit_misc:which_applications()},
{os, os:type()},
{rabbitmq_version, Version},
{crypto_lib_info, CryptoLibInfo},
{erlang_version, erlang:system_info(system_version)},
{release_series_support_status, SeriesSupportStatus},
{memory, rabbit_vm:memory()},
{alarms, alarms()},
{is_under_maintenance, rabbit_maintenance:is_being_drained_local_read(node())},
Expand Down Expand Up @@ -879,7 +877,6 @@ start(normal, []) ->
?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE],
#{domain => ?RMQLOG_DOMAIN_PRELAUNCH})
end,
maybe_warn_about_release_series_eol(),
log_motd(),
{ok, SupPid} = rabbit_sup:start_link(),

Expand Down Expand Up @@ -1225,7 +1222,6 @@ print_banner() ->
%% padded list lines
{LogFmt, LogLocations} = LineListFormatter("~n ~ts", log_locations()),
{CfgFmt, CfgLocations} = LineListFormatter("~n ~ts", config_locations()),
SeriesSupportStatus = rabbit_release_series:readable_support_status(),
{MOTDFormat, MOTDArgs} = case motd() of
undefined ->
{"", []};
Expand All @@ -1243,7 +1239,7 @@ print_banner() ->
MOTDFormat ++
"~n Erlang: ~ts [~ts]"
"~n TLS Library: ~ts"
"~n Release series support status: ~ts"
"~n Release series support status: see https://www.rabbitmq.com/release-information"
"~n"
"~n Doc guides: https://rabbitmq.com/documentation.html"
"~n Support: https://rabbitmq.com/contact.html"
Expand All @@ -1254,12 +1250,12 @@ print_banner() ->
"~n Config file(s): ~ts" ++ CfgFmt ++ "~n"
"~n Starting broker...",
[Product, Version, ?COPYRIGHT_MESSAGE, ?INFORMATION_MESSAGE] ++
[rabbit_misc:otp_release(), emu_flavor(), crypto_version(),
SeriesSupportStatus] ++
[rabbit_misc:otp_release(), emu_flavor(), crypto_version()] ++
MOTDArgs ++
LogLocations ++
CfgLocations).

<<<<<<< HEAD
maybe_warn_about_release_series_eol() ->
case rabbit_release_series:is_currently_supported() of
false ->
Expand All @@ -1271,6 +1267,8 @@ maybe_warn_about_release_series_eol() ->
_ -> ok
end.

=======
>>>>>>> 53c67ce45b (rabbitmq-diagnostics status: drop date-based support status field)
emu_flavor() ->
%% emu_flavor was introduced in Erlang 24 so we need to catch the error on Erlang 23
case catch(erlang:system_info(emu_flavor)) of
Expand Down
23 changes: 8 additions & 15 deletions deps/rabbit/src/rabbit_release_series.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,23 @@
-define(EOL_DATE_KEY, release_series_eol_date).

-export([
eol_date/0,
is_currently_supported/0,
readable_support_status/0
]).

-spec eol_date() -> rabbit_types:maybe(calendar:date()).
eol_date() ->
case application:get_env(rabbit, ?EOL_DATE_KEY) of
undefined -> none;
{ok, none} -> none;
{ok, {_Y, _M, _D} = Date} -> Date;
_ -> none
end.

%% Retained for backwards compatibility with older CLI tools.
-spec is_currently_supported() -> boolean().
is_currently_supported() ->
case eol_date() of
none -> true;
Date -> not rabbit_date_time:is_in_the_past(Date)
end.
true.

%% Retained for backwards compatibility with older CLI tools.
-spec readable_support_status() -> binary().
readable_support_status() ->
<<<<<<< HEAD
case is_currently_supported() of
false -> <<"out of support">>;
_ -> <<"supported">>
end.
end.
=======
<<"supported">>.
>>>>>>> 53c67ce45b (rabbitmq-diagnostics status: drop date-based support status field)
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.StatusCommand do
product_version_section ++
[
"RabbitMQ version: #{m[:rabbitmq_version]}",
"RabbitMQ release series support status: #{m[:release_series_support_status]}",
"RabbitMQ release series support status: see https://www.rabbitmq.com/release-information",
"Node name: #{node_name}",
"Erlang configuration: #{m[:erlang_version]}",
"Crypto library: #{m[:crypto_lib_version]}",
Expand Down

0 comments on commit f33bf80

Please sign in to comment.