rabbit_boot_steps: Search boot steps only in RabbitMQ-related apps #10064
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 onrabbit
, so excluded applications are already broken.