Skip to content

Commit 019cc01

Browse files
Merge pull request #2900 from rabbitmq/mk-erlang-24-compatibility-backports
Erlang 24 compatibility backports for 3.8.x
2 parents f90b4be + 17aacfb commit 019cc01

File tree

178 files changed

+1981
-1351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+1981
-1351
lines changed

deps/rabbit/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers amqp_client meck prop
143143

144144
PLT_APPS += mnesia
145145

146-
dep_cuttlefish = hex 2.6.0
146+
dep_cuttlefish = hex 3.0.0
147147
dep_syslog = git https://github.com/schlagert/syslog 3.4.5
148148

149149
define usage_xml_to_erl

deps/rabbit/apps/rabbitmq_prelaunch/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.coverdata
66
/ebin/
77
/.erlang.mk/
8+
/logs/
89
/rabbitmq_prelaunch.d
910
/xrefr
1011

deps/rabbit/apps/rabbitmq_prelaunch/src/rabbit_boot_state.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ get() ->
3636

3737
-spec set(boot_state()) -> ok.
3838
set(BootState) ->
39-
rabbit_log_prelaunch:debug("Change boot state to `~s`", [BootState]),
39+
_ = rabbit_log_prelaunch:debug("Change boot state to `~s`", [BootState]),
4040
?assert(is_valid(BootState)),
4141
case BootState of
4242
stopped -> persistent_term:erase(?PT_KEY_BOOT_STATE);

deps/rabbit/apps/rabbitmq_prelaunch/src/rabbit_boot_state_systemd.erl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ code_change(_OldVsn, State, _Extra) ->
7474

7575
notify_boot_state(ready = BootState,
7676
#state{mechanism = legacy, sd_notify_module = SDNotify}) ->
77-
rabbit_log_prelaunch:debug(
77+
_ = rabbit_log_prelaunch:debug(
7878
?LOG_PREFIX "notifying of state `~s` (via native module)",
7979
[BootState]),
8080
sd_notify_legacy(SDNotify);
8181
notify_boot_state(ready = BootState,
8282
#state{mechanism = socat, socket = Socket}) ->
83-
rabbit_log_prelaunch:debug(
83+
_ = rabbit_log_prelaunch:debug(
8484
?LOG_PREFIX "notifying of state `~s` (via socat(1))",
8585
[BootState]),
8686
sd_notify_socat(Socket);
8787
notify_boot_state(BootState, _) ->
88-
rabbit_log_prelaunch:debug(
88+
_ = rabbit_log_prelaunch:debug(
8989
?LOG_PREFIX "ignoring state `~s`",
9090
[BootState]),
9191
ok.
@@ -108,7 +108,7 @@ sd_notify_legacy(SDNotify) ->
108108
sd_notify_socat(Socket) ->
109109
case sd_current_unit() of
110110
{ok, Unit} ->
111-
rabbit_log_prelaunch:debug(
111+
_ = rabbit_log_prelaunch:debug(
112112
?LOG_PREFIX "systemd unit for activation check: \"~s\"~n",
113113
[Unit]),
114114
sd_notify_socat(Socket, Unit);
@@ -125,7 +125,7 @@ sd_notify_socat(Socket, Unit) ->
125125
Result
126126
catch
127127
Class:Reason ->
128-
rabbit_log_prelaunch:debug(
128+
_ = rabbit_log_prelaunch:debug(
129129
?LOG_PREFIX "Failed to start socat(1): ~p:~p~n",
130130
[Class, Reason]),
131131
false
@@ -156,7 +156,7 @@ sd_open_port(Socket) ->
156156
sd_wait_activation(Port, Unit) ->
157157
case os:find_executable("systemctl") of
158158
false ->
159-
rabbit_log_prelaunch:debug(
159+
_ = rabbit_log_prelaunch:debug(
160160
?LOG_PREFIX "systemctl(1) unavailable, falling back to sleep~n"),
161161
timer:sleep(5000),
162162
ok;
@@ -165,7 +165,7 @@ sd_wait_activation(Port, Unit) ->
165165
end.
166166

167167
sd_wait_activation(_, _, 0) ->
168-
rabbit_log_prelaunch:debug(
168+
_ = rabbit_log_prelaunch:debug(
169169
?LOG_PREFIX "service still in 'activating' state, bailing out~n"),
170170
ok;
171171
sd_wait_activation(Port, Unit, AttemptsLeft) ->
@@ -177,7 +177,7 @@ sd_wait_activation(Port, Unit, AttemptsLeft) ->
177177
"ActiveState=" ++ _ ->
178178
ok;
179179
_ = Err ->
180-
rabbit_log_prelaunch:debug(
180+
_ = rabbit_log_prelaunch:debug(
181181
?LOG_PREFIX "unexpected status from systemd: ~p~n", [Err]),
182182
ok
183183
end.

deps/rabbit/apps/rabbitmq_prelaunch/src/rabbit_prelaunch.erl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ do_run() ->
7272
IsInitialPass = is_initial_pass(),
7373
case IsInitialPass of
7474
true ->
75-
rabbit_log_prelaunch:debug(""),
76-
rabbit_log_prelaunch:debug(
75+
_ = rabbit_log_prelaunch:debug(""),
76+
_ = rabbit_log_prelaunch:debug(
7777
"== Prelaunch phase [1/2] (initial pass) =="),
78-
rabbit_log_prelaunch:debug("");
78+
_ = rabbit_log_prelaunch:debug("");
7979
false ->
80-
rabbit_log_prelaunch:debug(""),
81-
rabbit_log_prelaunch:debug("== Prelaunch phase [1/2] =="),
82-
rabbit_log_prelaunch:debug("")
80+
_ = rabbit_log_prelaunch:debug(""),
81+
_ = rabbit_log_prelaunch:debug("== Prelaunch phase [1/2] =="),
82+
_ = rabbit_log_prelaunch:debug("")
8383
end,
8484
rabbit_env:log_process_env(),
8585

@@ -111,7 +111,7 @@ do_run() ->
111111
ok = rabbit_prelaunch_dist:setup(Context),
112112

113113
%% 4. Write PID file.
114-
rabbit_log_prelaunch:debug(""),
114+
_ = rabbit_log_prelaunch:debug(""),
115115
_ = write_pid_file(Context),
116116
ignore.
117117

@@ -138,7 +138,7 @@ get_stop_reason() ->
138138
set_stop_reason(Reason) ->
139139
case get_stop_reason() of
140140
undefined ->
141-
rabbit_log_prelaunch:debug("Set stop reason to: ~p", [Reason]),
141+
_ = rabbit_log_prelaunch:debug("Set stop reason to: ~p", [Reason]),
142142
persistent_term:put(?PT_KEY_STOP_REASON, Reason);
143143
_ ->
144144
ok
@@ -161,7 +161,7 @@ setup_shutdown_func() ->
161161
{ok, {ThisMod, ThisFunc}} ->
162162
ok;
163163
{ok, {ExistingMod, ExistingFunc}} ->
164-
rabbit_log_prelaunch:debug(
164+
_ = rabbit_log_prelaunch:debug(
165165
"Setting up kernel shutdown function: ~s:~s/1 "
166166
"(chained with ~s:~s/1)",
167167
[ThisMod, ThisFunc, ExistingMod, ExistingFunc]),
@@ -170,7 +170,7 @@ setup_shutdown_func() ->
170170
ExistingShutdownFunc),
171171
ok = record_kernel_shutdown_func(ThisMod, ThisFunc);
172172
_ ->
173-
rabbit_log_prelaunch:debug(
173+
_ = rabbit_log_prelaunch:debug(
174174
"Setting up kernel shutdown function: ~s:~s/1",
175175
[ThisMod, ThisFunc]),
176176
ok = record_kernel_shutdown_func(ThisMod, ThisFunc)
@@ -182,7 +182,7 @@ record_kernel_shutdown_func(Mod, Func) ->
182182
[{persistent, true}]).
183183

184184
shutdown_func(Reason) ->
185-
rabbit_log_prelaunch:debug(
185+
_ = rabbit_log_prelaunch:debug(
186186
"Running ~s:shutdown_func() as part of `kernel` shutdown", [?MODULE]),
187187
Context = get_context(),
188188
remove_pid_file(Context),
@@ -195,21 +195,21 @@ shutdown_func(Reason) ->
195195
end.
196196

197197
write_pid_file(#{pid_file := PidFile}) ->
198-
rabbit_log_prelaunch:debug("Writing PID file: ~s", [PidFile]),
198+
_ = rabbit_log_prelaunch:debug("Writing PID file: ~s", [PidFile]),
199199
case filelib:ensure_dir(PidFile) of
200200
ok ->
201201
OSPid = os:getpid(),
202202
case file:write_file(PidFile, OSPid) of
203203
ok ->
204204
ok;
205205
{error, Reason} = Error ->
206-
rabbit_log_prelaunch:warning(
206+
_ = rabbit_log_prelaunch:warning(
207207
"Failed to write PID file \"~s\": ~s",
208208
[PidFile, file:format_error(Reason)]),
209209
Error
210210
end;
211211
{error, Reason} = Error ->
212-
rabbit_log_prelaunch:warning(
212+
_ = rabbit_log_prelaunch:warning(
213213
"Failed to create PID file \"~s\" directory: ~s",
214214
[PidFile, file:format_error(Reason)]),
215215
Error
@@ -218,10 +218,10 @@ write_pid_file(_) ->
218218
ok.
219219

220220
remove_pid_file(#{pid_file := PidFile, keep_pid_file_on_exit := true}) ->
221-
rabbit_log_prelaunch:debug("Keeping PID file: ~s", [PidFile]),
221+
_ = rabbit_log_prelaunch:debug("Keeping PID file: ~s", [PidFile]),
222222
ok;
223223
remove_pid_file(#{pid_file := PidFile}) ->
224-
rabbit_log_prelaunch:debug("Deleting PID file: ~s", [PidFile]),
224+
_ = rabbit_log_prelaunch:debug("Deleting PID file: ~s", [PidFile]),
225225
_ = file:delete(PidFile),
226226
ok;
227227
remove_pid_file(_) ->

0 commit comments

Comments
 (0)