-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Ruler: protect overrides map with mutex when accessing tenant configs #11601
Ruler: protect overrides map with mutex when accessing tenant configs #11601
Conversation
This doesn't need to be locked in a fine-grained way because this isn't on the hot path Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
Trivy scan found the following vulnerabilities:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think we need to add a changelog entry.
Considered it but I don't really see the value in tracking these minor bugfixes? I can easily be convinced, though. |
IMO, any bugfix should get a changelog entry and should be backported. People who face this issue should be able to see that is been fixed in a certain release. |
Fair point about the backport, didn't consider that; that naturally requires the CHANGELOG entry |
Co-authored-by: Christian Haudum <christian.haudum@gmail.com>
…#11601) **What this PR does / why we need it**: A ruler handling many hundreds of rules can provoke a situation where the WAL appender reads & modifies tenant configs concurrently in an unsafe way; this PR protects that with a mutex. **Which issue(s) this PR fixes**: Fixes #11569 (cherry picked from commit cd3cf62)
…#11601) **What this PR does / why we need it**: A ruler handling many hundreds of rules can provoke a situation where the WAL appender reads & modifies tenant configs concurrently in an unsafe way; this PR protects that with a mutex. **Which issue(s) this PR fixes**: Fixes #11569 (cherry picked from commit cd3cf62)
Expands on #11601 **What this PR does / why we need it**: Turns out the previous tests didn't expose all possible causes for data races (another one occurs at https://github.com/grafana/loki/blob/5a55158cc751465846383bc758aa0c169363b292/pkg/ruler/registry.go#L204). Moving the mutex to the calling function adds more safety. **Which issue(s) this PR fixes**: Fixes #11569 Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
Expands on #11601 **What this PR does / why we need it**: Turns out the previous tests didn't expose all possible causes for data races (another one occurs at https://github.com/grafana/loki/blob/5a55158cc751465846383bc758aa0c169363b292/pkg/ruler/registry.go#L204). Moving the mutex to the calling function adds more safety. **Which issue(s) this PR fixes**: Fixes #11569 Signed-off-by: Danny Kopping <danny.kopping@grafana.com> (cherry picked from commit 61a4205)
Expands on #11601 **What this PR does / why we need it**: Turns out the previous tests didn't expose all possible causes for data races (another one occurs at https://github.com/grafana/loki/blob/5a55158cc751465846383bc758aa0c169363b292/pkg/ruler/registry.go#L204). Moving the mutex to the calling function adds more safety. **Which issue(s) this PR fixes**: Fixes #11569 Signed-off-by: Danny Kopping <danny.kopping@grafana.com> (cherry picked from commit 61a4205)
#11714) Backport 61a4205 from #11612 --- Expands on #11601 **What this PR does / why we need it**: Turns out the previous tests didn't expose all possible causes for data races (another one occurs at https://github.com/grafana/loki/blob/5a55158cc751465846383bc758aa0c169363b292/pkg/ruler/registry.go#L204). Moving the mutex to the calling function adds more safety. **Which issue(s) this PR fixes**: Fixes #11569 Co-authored-by: Danny Kopping <danny.kopping@grafana.com>
#11715) Backport 61a4205 from #11612 --- Expands on #11601 **What this PR does / why we need it**: Turns out the previous tests didn't expose all possible causes for data races (another one occurs at https://github.com/grafana/loki/blob/5a55158cc751465846383bc758aa0c169363b292/pkg/ruler/registry.go#L204). Moving the mutex to the calling function adds more safety. **Which issue(s) this PR fixes**: Fixes #11569 Co-authored-by: Danny Kopping <danny.kopping@grafana.com>
…grafana#11601) **What this PR does / why we need it**: A ruler handling many hundreds of rules can provoke a situation where the WAL appender reads & modifies tenant configs concurrently in an unsafe way; this PR protects that with a mutex. **Which issue(s) this PR fixes**: Fixes grafana#11569
Expands on grafana#11601 **What this PR does / why we need it**: Turns out the previous tests didn't expose all possible causes for data races (another one occurs at https://github.com/grafana/loki/blob/5a55158cc751465846383bc758aa0c169363b292/pkg/ruler/registry.go#L204). Moving the mutex to the calling function adds more safety. **Which issue(s) this PR fixes**: Fixes grafana#11569 Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
What this PR does / why we need it:
A ruler handling many hundreds of rules can provoke a situation where the WAL appender reads & modifies tenant configs concurrently in an unsafe way; this PR protects that with a mutex.
Which issue(s) this PR fixes:
Fixes #11569
Special notes for your reviewer:
This doesn't need to be locked in a fine-grained way because this isn't on the hot path.
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updatedadd-to-release-notes
labeldocs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR