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

Improve memory limit on the in-memory cache used for regular expression matchers #4751

Merged
merged 4 commits into from
Apr 17, 2023

Conversation

pracucci
Copy link
Collaborator

What this PR does

Updating Prometheus to get grafana/mimir-prometheus#482. This will have to be cherry-picked into 2.8 release.

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

…on matchers

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci requested a review from a team as a code owner April 17, 2023 13:24
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But the CI seems to complain about leaking goroutines.

CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci
Copy link
Collaborator Author

LGTM. But the CI seems to complain about leaking goroutines.

Right. This should address it: c5d2f54

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// the label matchers not comparable with reflect.DeepEqual() so we're going to
// compare their string representation.
require.Len(t, decodedMatchers, len(matchers))
for i := 0; i < len(matchers); i++ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
for i := 0; i < len(matchers); i++ {
for i := range matchers {

but if you don't want to wait for CI again, feel free to disregard this

@pracucci pracucci merged commit 020e69d into main Apr 17, 2023
19 checks passed
@pracucci pracucci deleted the update-prometheus branch April 17, 2023 15:22
aldernero pushed a commit that referenced this pull request Apr 17, 2023
…on matchers (#4751)

* Improve memory limit on the in-memory cache used for regular expression matchers

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed CHANGELOG

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Ignore ristretto.Cache goroutines

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fix unit tests

Signed-off-by: Marco Pracucci <marco@pracucci.com>

---------

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@grafanabot
Copy link
Contributor

The backport to release-2.8 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-4751-to-release-2.8 origin/release-2.8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 020e69d80bfd5ca5f6dfddc9fe341f7aa027f8c9
# Push it to GitHub
git push --set-upstream origin backport-4751-to-release-2.8
git switch main
# Remove the local backport branch
git branch -D backport-4751-to-release-2.8

Then, create a pull request where the base branch is release-2.8 and the compare/head branch is backport-4751-to-release-2.8.

lamida pushed a commit that referenced this pull request Apr 17, 2023
…on matchers (#4751)

* Improve memory limit on the in-memory cache used for regular expression matchers

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed CHANGELOG

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Ignore ristretto.Cache goroutines

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fix unit tests

Signed-off-by: Marco Pracucci <marco@pracucci.com>

---------

Signed-off-by: Marco Pracucci <marco@pracucci.com>
(cherry picked from commit 020e69d)
lamida pushed a commit that referenced this pull request Apr 18, 2023
…on matchers (#4751)

* Improve memory limit on the in-memory cache used for regular expression matchers

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed CHANGELOG

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Ignore ristretto.Cache goroutines

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fix unit tests

Signed-off-by: Marco Pracucci <marco@pracucci.com>

---------

Signed-off-by: Marco Pracucci <marco@pracucci.com>
(cherry picked from commit 020e69d)
56quarters pushed a commit that referenced this pull request Apr 18, 2023
…on matchers (#4751) (#4758)

* Improve memory limit on the in-memory cache used for regular expression matchers

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed CHANGELOG

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Ignore ristretto.Cache goroutines

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fix unit tests

Signed-off-by: Marco Pracucci <marco@pracucci.com>

---------

Signed-off-by: Marco Pracucci <marco@pracucci.com>
(cherry picked from commit 020e69d)

Co-authored-by: Marco Pracucci <marco@pracucci.com>
pracucci pushed a commit that referenced this pull request Apr 18, 2023
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci mentioned this pull request Apr 18, 2023
3 tasks
pracucci added a commit that referenced this pull request Apr 18, 2023
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Co-authored-by: Jon Kartago Lamida <jon.lamida@grafana.com>
@andyasp andyasp mentioned this pull request Apr 19, 2023
3 tasks
@lamida lamida mentioned this pull request Apr 20, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants