Skip to content
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

rabbit_feature_flags: Lock registry once and enable many feature flags #12441

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Oct 3, 2024

Why

Before this change, the controller was looping on all feature flags to enable, then for each:

  1. it checked if it was supported
  2. it acquired the registry lock
  3. it enabled the feature flag
  4. it released the registry lock

It was done this way to not acquire the log if the feature flag was unsupported in the first place.

However, this put more load on the lock mechanism.

How

This commit changes the order. The controller acquires the registry lock once, then loops on feature flags to enable. The support check is now under the registry lock.

While here, fix copyright years in all modules of the feature flags subsystem.

@dumbbell dumbbell added this to the 4.1.0 milestone Oct 3, 2024
@dumbbell dumbbell self-assigned this Oct 3, 2024
[Why]
Before this change, the controller was looping on all feature flags to
enable, then for each:
1. it checked if it was supported
2. it acquired the registry lock
3. it enabled the feature flag
4. it released the registry lock

It was done this way to not acquire the log if the feature flag was
unsupported in the first place.

However, this put more load on the lock mechanism.

[How]
This commit changes the order. The controller acquires the registry lock
once, then loops on feature flags to enable. The support check is now
under the registry lock.
The subsystem didn't exist before 2019. The deprecated features support
was added in 2023.
@dumbbell dumbbell force-pushed the lock-feature-flags-registry-then-enable-many branch from 8ddc4f0 to e4abbfd Compare October 3, 2024 11:04
@dumbbell dumbbell marked this pull request as ready for review October 3, 2024 13:11
@dumbbell dumbbell merged commit 5bc0bcd into main Oct 3, 2024
440 checks passed
@dumbbell dumbbell deleted the lock-feature-flags-registry-then-enable-many branch October 3, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant