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

Schema leak #522

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Schema leak #522

merged 3 commits into from
Nov 25, 2024

Conversation

joshmeranda
Copy link
Contributor

@joshmeranda joshmeranda commented Oct 24, 2024

We neglect to remove schemas from s.schemas in s.doRemoveSchema which results in duplicate entries in s.schemas which are never removed. This introduces a memory leak of ~300 mb a week on a large rancher cluster.

rancher/rancher#47694

@joshmeranda joshmeranda requested a review from a team as a code owner October 24, 2024 16:12
Copy link

@aruiz14 aruiz14 left a comment

Choose a reason for hiding this comment

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

Nice find!

types/schemas.go Outdated Show resolved Hide resolved
nflynt
nflynt previously approved these changes Oct 30, 2024
Copy link
Contributor

@ericpromislow ericpromislow left a comment

Choose a reason for hiding this comment

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

Since we're introducing slices now, the search code at lines 144-148 could be replaced with a call to slices.IndexFunc.

Copy link
Contributor

@ericpromislow ericpromislow left a comment

Choose a reason for hiding this comment

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

Looks great

@joshmeranda joshmeranda requested a review from nflynt November 25, 2024 18:22
@joshmeranda joshmeranda merged commit b4a72e5 into rancher:main Nov 25, 2024
1 check passed
@joshmeranda joshmeranda deleted the schema-leak branch November 27, 2024 14:20
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.

5 participants