Skip to content

Commit 0dc732f

Browse files
Merge pull request #11451 from rabbitmq/mergify/bp/v3.13.x/pr-11414
rabbit_feature_flags: Avoid deadlock on terminating controller (backport #11414)
2 parents 9aa0596 + 4b50bdd commit 0dc732f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

deps/rabbit/src/rabbit_ff_controller.erl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ terminate(_Reason, _State, _Data) ->
306306
ok.
307307

308308
wait_for_in_flight_operations() ->
309+
case global:whereis_name(?GLOBAL_NAME) of
310+
Pid when Pid == self() ->
311+
ok;
312+
_ ->
313+
wait_for_in_flight_operations0()
314+
end.
315+
316+
wait_for_in_flight_operations0() ->
309317
case register_globally() of
310318
yes ->
311319
%% We don't unregister so the controller holds the lock until it

0 commit comments

Comments
 (0)