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

Change how we cache the keys in backend.Reporter #29323

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

espadolini
Copy link
Contributor

This fixes a memory leak caused by hashicorp/golang-lru#141 in strange workloads where all or almost all writes end up on the same metric key.

Copy link
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

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

Any other occurrences of this we should worry about?

lib/backend/report.go Outdated Show resolved Hide resolved
lib/backend/report.go Outdated Show resolved Hide resolved
@espadolini espadolini enabled auto-merge July 19, 2023 20:54
@espadolini
Copy link
Contributor Author

Any other occurrences of this we should worry about?

I believe that only the NewWithEvict constructor is affected, as all the places that the leak might possible hide in are gated behind c.onEvictedCB != nil - in the New constructor that condition isn't verified.

@espadolini
Copy link
Contributor Author

(and this was the only place where we use NewWithEvict)

@espadolini espadolini added this pull request to the merge queue Jul 19, 2023
Merged via the queue into master with commit b258e75 Jul 19, 2023
@espadolini espadolini deleted the espadolini/reporter-lru branch July 19, 2023 21:25
@public-teleport-github-review-bot

@espadolini See the table below for backport results.

Branch Result
branch/v11 Create PR
branch/v12 Create PR
branch/v13 Create PR

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.

3 participants