Skip to content

Fix memory leaks in master's maintenance process - #58811

Closed
dwoz wants to merge 2 commits into
saltstack:masterfrom
dwoz:issue_58785
Closed

dwoz wants to merge 2 commits into
saltstack:masterfrom
dwoz:issue_58785

Conversation

@dwoz

@dwoz dwoz commented Oct 26, 2020 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix memory leaks in Master's Maintenance process

What issues does this PR fix or reference?

Fixes: #58785 #58791 #58813

We will be partially reverting the loader changes from 3002 in #58862

This PR is still valid to fix a minor memory leak that happened in the salt master's maintenance process prior to the 3002 release.

Previous Behavior

The methods to clean expired jobs and clean old tokens both created multiple loader instances every time they ran.

New Behavior

Create an object that uses a single instance of the objects which create multiple loaders so that loaders are re-used.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

@dwoz
dwoz requested a review from a team as a code owner October 26, 2020 01:09
@dwoz
dwoz requested review from garethgreenaway and removed request for a team October 26, 2020 01:09
s0undt3ch
s0undt3ch previously approved these changes Oct 26, 2020
@ixs

ixs commented Oct 27, 2020

Copy link
Copy Markdown
Contributor

Just so that it's clearly spelled out here as well:

I've been running this on a local build and the memory consumption of the maintenance worker seems mostly stable.

But this is not a fix for #58791, which is happening due to MWorkers having massive memory consumption and being killed by the oom worker.

@sagetherage sagetherage linked an issue Oct 27, 2020 that may be closed by this pull request
@ixs

ixs commented Oct 27, 2020

Copy link
Copy Markdown
Contributor

@sagetherage I really hate being the bearer of bad news, but #58791 is not fixed by this issue. I am running a local build with this fix and it does not solve the specific problem.

@sagetherage sagetherage added the v3002.2 vulnerable version label Oct 29, 2020
@dwoz dwoz added Aluminium Release Post Mg and Pre Si and removed v3002.2 vulnerable version labels Nov 12, 2020
@sagetherage sagetherage linked an issue Jan 4, 2021 that may be closed by this pull request
@Orlando-Richards

Copy link
Copy Markdown
Contributor

+1 for this patch - we noticed that our salt-master (3002.1) was growing at about 1MByte per minute, even with all the minions and api clients turned off. After applying this patch, it's sat completely stable.

@Orlando-Richards

Orlando-Richards commented Jan 18, 2021 •

Copy link
Copy Markdown
Contributor

+1 for this patch - we noticed that our salt-master (3002.1) was growing at about 1MByte per minute, even with all the minions and api clients turned off. After applying this patch, it's sat completely stable.

Only required on salt < 3002.2 - after testing this patch on salt 3002.1, I then updated to salt 3002.2 (without this patch) and that resolved this leak (along with a leak on a salt-proxy). Hurrah!

I would suggest that this PR is closed.

@TheBirdsNest

Copy link
Copy Markdown

Sadly this is still an issue for salt-proxy by the looks of it. Running 3003.2 and my proxies are using 8GB ram and climbing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Aluminium Release Post Mg and Pre Si

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] extreme memory leak in Maintenance process.

7 participants