Skip to content

rabbit_boot_steps: Search boot steps only in RabbitMQ-related apps #10064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

dumbbell
Copy link
Collaborator

@dumbbell dumbbell commented Dec 7, 2023

Why

We used to search for boot steps (i.e. rabbit_boot_step module attributes) in every modules in every Erlang loaded applications. This included the Erlang/OTP standard libraries and all depedencies.

This takes a looot of time. That's a lot of applications where we will never find a boot step anyway. So most of this time is wasted.

How

rabbit_misc:rabbitmq_related_module_attributes/1 was introduced for the Feature flags subsystem for the same need to search for specific module attributes. This function only considers the RabbitMQ core and all plugins.

This saves a significant amount of time. And because all those modules were already loaded when RabbitMQ search for feature flags earlier during boot, the boot steps lookup should be quite fast.

We could consider this a change of behavior because applications which didn't depend on the rabbit application are now excluded from the search. But all plugins should depend on rabbit, so excluded applications are already broken.

@dumbbell dumbbell self-assigned this Dec 7, 2023
@dumbbell dumbbell force-pushed the lookup-boot-steps-in-core-and-plugins-only branch from d5da244 to a44c105 Compare December 7, 2023 15:05
[Why]
We used to search for boot steps (i.e. `rabbit_boot_step` module
attributes) in every modules in every Erlang loaded applications. This
included the Erlang/OTP standard libraries and all depedencies.

This takes a looot of time. That's a lot of applications where we will
never find a boot step anyway. So most of this time is wasted.

[How]
`rabbit_misc:rabbitmq_related_module_attributes/1` was introduced for
the Feature flags subsystem for the same need to search for specific
module attributes. This function only considers the RabbitMQ core and
all plugins.

This saves a significant amount of time. And because all those modules
were already loaded when RabbitMQ search for feature flags earlier
during boot, the boot steps lookup should be quite fast.

We could consider this a change of behavior because applications which
didn't depend on the `rabbit` application are now excluded from the
search. But all plugins should depend on `rabbit`, so excluded
applications are already broken.
@dumbbell dumbbell force-pushed the lookup-boot-steps-in-core-and-plugins-only branch from a44c105 to 33e507b Compare December 8, 2023 10:24
@dumbbell dumbbell requested a review from mkuratczyk December 8, 2023 12:03
@dumbbell dumbbell marked this pull request as ready for review December 8, 2023 12:03
@mkuratczyk mkuratczyk merged commit ad5707f into main Dec 8, 2023
@mkuratczyk mkuratczyk deleted the lookup-boot-steps-in-core-and-plugins-only branch December 8, 2023 12:28
@dumbbell dumbbell added this to the 3.13.0 milestone Dec 8, 2023
michaelklishin pushed a commit that referenced this pull request Feb 29, 2024
…10064)

[Why]
We used to search for boot steps (i.e. `rabbit_boot_step` module
attributes) in every modules in every Erlang loaded applications. This
included the Erlang/OTP standard libraries and all depedencies.

This takes a looot of time. That's a lot of applications where we will
never find a boot step anyway. So most of this time is wasted.

[How]
`rabbit_misc:rabbitmq_related_module_attributes/1` was introduced for
the Feature flags subsystem for the same need to search for specific
module attributes. This function only considers the RabbitMQ core and
all plugins.

This saves a significant amount of time. And because all those modules
were already loaded when RabbitMQ search for feature flags earlier
during boot, the boot steps lookup should be quite fast.

We could consider this a change of behavior because applications which
didn't depend on the `rabbit` application are now excluded from the
search. But all plugins should depend on `rabbit`, so excluded
applications are already broken.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants