Skip to content

Commit 1500de4

Browse files
authored
Merge pull request #11446 from rabbitmq/mergify/bp/v3.13.x/pr-11437
rabbit: Stop `rabbitmq_prelaunch` if we fail to start `rabbit` (backport #11437)
2 parents deca198 + 5bf280a commit 1500de4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,16 @@ start_it(StartType) ->
428428
ok
429429
catch
430430
error:{badmatch, Error}:_ ->
431+
%% `rabbitmq_prelaunch' was started before `rabbit' above.
432+
%% If the latter fails to start, we must stop the former as
433+
%% well.
434+
%%
435+
%% This is important if the environment changes between
436+
%% that error and the next attempt to start `rabbit': the
437+
%% environment is only read during the start of
438+
%% `rabbitmq_prelaunch' (and the cached context is cleaned
439+
%% on stop).
440+
_ = application:stop(rabbitmq_prelaunch),
431441
stop_boot_marker(Marker),
432442
case StartType of
433443
temporary -> throw(Error);

0 commit comments

Comments
 (0)