Skip to content

Commit 9aead56

Browse files
Export definitions on boot after all plugins have been enabled
This way definitions that depend on a plugin, such as federation upstreams or exchanges of custom types, can be imported successfully. Closes #2384
1 parent f8c36c2 commit 9aead56

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/rabbit.erl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,7 @@
104104
-rabbit_boot_step({definition_import_worker_pool,
105105
[{description, "dedicated worker pool for definition import"},
106106
{mfa, {rabbit_definitions, boot, []}},
107-
{requires, external_infrastructure},
108-
{enables, load_core_definitions}]}).
109-
110-
%% We want to A) make sure we apply definitions before the node begins serving
111-
%% traffic and B) in fact do it before empty_db_check (so the defaults will not
112-
%% get created if we don't need 'em).
113-
-rabbit_boot_step({load_core_definitions,
114-
[{description, "imports definitions"},
115-
{mfa, {rabbit_definitions, maybe_load_definitions, []}},
116-
{requires, [recovery, definition_import_worker_pool]},
117-
{enables, empty_db_check}]}).
107+
{requires, external_infrastructure}]}).
118108

119109
-rabbit_boot_step({external_infrastructure,
120110
[{description, "external infrastructure ready"}]}).
@@ -935,7 +925,10 @@ do_run_postlaunch_phase() ->
935925

936926
ok = rabbit_lager:broker_is_started(),
937927
ok = log_broker_started(
938-
rabbit_plugins:strictly_plugins(rabbit_plugins:active()))
928+
rabbit_plugins:strictly_plugins(rabbit_plugins:active())),
929+
%% export definitions after all plugins have been enabled,
930+
%% see rabbitmq/rabbitmq-server#2384
931+
rabbit_definitions:maybe_load_definitions()
939932
catch
940933
throw:{error, _} = Error ->
941934
rabbit_prelaunch_errors:log_error(Error),

0 commit comments

Comments
 (0)