Skip to content

rabbit_feature_flags: Reset the registry before the boot-time init #8749

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 2 commits into from
Jul 4, 2023

Conversation

dumbbell
Copy link
Collaborator

@dumbbell dumbbell commented Jul 4, 2023

Why

After a stop_app + start_app, the feature flags registry is left loaded. If the deprecated features are reconfigured in the configuration file in between, their new state won't be taken into account if the registry initialization is skipped because it is already loaded.

Therefore, we need to reset the registry before we proceed with the first initialization. That's ok because feature flags states were saved to disc already. It will be restored correctly like if the Erlang node was fully stopped and restarted.

How

We unload the rabbit_ff_registry module just before we initialize it again in rabbit_prelaunch_feature_flags.

dumbbell added 2 commits July 4, 2023 11:22
[Why]
After a `stop_app` + `start_app`, the feature flags registry is left
loaded. If the deprecated features are reconfigured in the configuration
file in between, their new state won't be taken into account if the
registry initialization is skipped because it is already loaded.

Therefore, we need to reset the registry before we proceed with the
first initialization. That's ok because feature flags states were saved
to disc already. It will be restored correctly like if the Erlang node
was fully stopped and restarted.

[How]
We unload the `rabbit_ff_registry` module just before we initialize it
again in `rabbit_prelaunch_feature_flags`.
…features` conf

[Why]
This makes it clear when default states are being used because there is
no configuration.
@dumbbell dumbbell added this to the 3.13.0 milestone Jul 4, 2023
@dumbbell dumbbell self-assigned this Jul 4, 2023
@dumbbell dumbbell marked this pull request as ready for review July 4, 2023 10:12
@dumbbell dumbbell merged commit fa25e4c into main Jul 4, 2023
@dumbbell dumbbell deleted the reset-feature-flags-registry-on-boot branch July 4, 2023 10:13
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.

1 participant