Skip to content

Commit 54bc464

Browse files
committed
rabbit_feature_flags: Fix registry reset vs. Erlang embedded mode
[Why] If the Erlang VM is running in embedded mode, it will refuse to auto-load any module from disk. That's because all modules are loaded from the Erlang release right from the start. [How] After purging the module, we explicitly reload the stub version from the disk.
1 parent 93f3fe7 commit 54bc464

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deps/rabbit/src/rabbit_ff_registry_factory.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,5 +842,9 @@ reset_registry() ->
842842
#{domain => ?RMQLOG_DOMAIN_FEAT_FLAGS}),
843843
_ = code:purge(rabbit_ff_registry),
844844
_ = code:delete(rabbit_ff_registry),
845+
%% After purging the module, we explicitly reload the stub version from the
846+
%% disk. We need to do this because if the Erlang VM is running in embedded
847+
%% mode, it will refuse to auto-load the module.
848+
_ = code:load_file(rabbit_ff_registry),
845849
?assertNot(rabbit_ff_registry:is_registry_initialized()),
846850
ok.

0 commit comments

Comments
 (0)