Repository navigation
Closed
Labels
bugbroken, incorrect, or confusing behaviorcannot-reproducecannot be replicated with info/context providedmemory-leak
Milestone
Description
Description
Memory usage of the Salt master's gpg-agent process grows constantly until eventual exhaustion.
pidstat -r -p $(pgrep gpg-agent) 60
12:05:28 UID PID minflt/s majflt/s VSZ RSS %MEM Command
12:06:28 0 2933164 183.27 0.00 231784 12332 0.21 gpg-agent
12:07:28 0 2933164 148.23 0.00 231784 12460 0.21 gpg-agent
12:08:28 0 2933164 0.00 0.00 231784 12460 0.21 gpg-agent
12:09:28 0 2933164 0.00 0.00 231784 12460 0.21 gpg-agent
12:10:28 0 2933164 6.17 0.00 231784 12460 0.21 gpg-agent
12:11:28 0 2933164 257.37 0.00 231784 12844 0.22 gpg-agent
12:12:28 0 2933164 0.00 0.00 231784 12844 0.22 gpg-agent
12:13:28 0 2933164 0.00 0.00 231784 12844 0.22 gpg-agent
12:14:28 0 2933164 45.28 0.00 231784 12972 0.22 gpg-agent
12:15:28 0 2933164 16.47 0.00 231784 12972 0.22 gpg-agent
12:16:28 0 2933164 131.77 0.00 231784 13228 0.22 gpg-agent
12:17:28 0 2933164 22.63 0.00 231784 13228 0.22 gpg-agent
12:18:28 0 2933164 0.00 0.00 231784 13228 0.22 gpg-agent
12:19:28 0 2933164 0.00 0.00 231784 13228 0.22 gpg-agent
12:20:28 0 2933164 32.97 0.00 231784 13228 0.22 gpg-agent
12:21:28 0 2933164 160.62 0.00 231784 13484 0.23 gpg-agent
12:22:28 0 2933164 260.13 0.00 231784 13740 0.23 gpg-agent
...
17:47:28 0 2933164 162.05 0.00 231784 39340 0.67 gpg-agent
17:48:28 0 2933164 236.98 0.00 231784 39852 0.68 gpg-agent
17:49:28 0 2933164 0.00 0.00 231784 39852 0.68 gpg-agent
17:50:28 0 2933164 22.30 0.00 231784 39852 0.68 gpg-agent
17:51:28 0 2933164 16.18 0.00 231784 39852 0.68 gpg-agent
17:52:28 0 2933164 254.08 0.00 231784 40108 0.68 gpg-agent
17:53:28 0 2933164 0.00 0.00 231784 40108 0.68 gpg-agent
17:54:28 0 2933164 0.00 0.00 231784 40108 0.68 gpg-agent
17:55:28 0 2933164 23.03 0.00 231784 40108 0.68 gpg-agent
17:56:28 0 2933164 23.03 0.00 231784 40108 0.68 gpg-agent
17:57:28 0 2933164 150.62 0.00 231784 40364 0.69 gpg-agent
17:58:28 0 2933164 23.03 0.00 231784 40364 0.69 gpg-agent
17:59:28 0 2933164 0.00 0.00 231784 40364 0.69 gpg-agent
...
09:08:28 0 2933164 0.00 0.00 231784 113964 1.93 gpg-agent
09:09:28 0 2933164 29.30 0.00 231784 114092 1.94 gpg-agent
09:10:28 0 2933164 0.00 0.00 231784 114092 1.94 gpg-agent
09:11:28 0 2933164 0.00 0.00 231784 114092 1.94 gpg-agent
09:12:28 0 2933164 23.02 0.00 231784 114092 1.94 gpg-agent
09:13:28 0 2933164 150.63 0.00 231784 114220 1.94 gpg-agent
09:14:28 0 2933164 0.00 0.00 231784 114220 1.94 gpg-agent
09:15:28 0 2933164 0.00 0.00 231784 114220 1.94 gpg-agent
09:16:28 0 2933164 39.77 0.00 231784 114476 1.94 gpg-agent
09:17:28 0 2933164 244.78 0.00 231784 114604 1.95 gpg-agent
09:18:28 0 2933164 75.28 0.00 231784 114860 1.95 gpg-agent
09:19:28 0 2933164 75.33 0.00 231784 114860 1.95 gpg-agent
09:20:28 0 2933164 23.02 0.00 231784 114860 1.95 gpg-agent
09:21:28 0 2933164 16.73 0.00 231784 114860 1.95 gpg-agent
09:22:28 0 2933164 108.80 0.00 231784 115116 1.95 gpg-agent
09:23:28 0 2933164 152.75 0.00 231784 115372 1.96 gpg-agent
... days later ...
09:59:09 0 2933164 46.73 0.10 960876 702124 11.92 gpg-agent
10:00:09 0 2933164 0.00 0.00 960876 701996 11.92 gpg-agent
10:01:09 0 2933164 281.82 0.05 960876 703276 11.94 gpg-agent
10:02:09 0 2933164 7.87 0.05 960876 703532 11.94 gpg-agent
10:03:09 0 2933164 327.27 71.05 960876 703916 11.95 gpg-agent
10:04:09 0 2933164 67.12 0.10 960876 703020 11.93 gpg-agent
10:05:09 0 2933164 0.00 0.00 960876 703020 11.93 gpg-agent
10:06:09 0 2933164 0.00 0.00 960876 703020 11.93 gpg-agent
10:07:09 0 2933164 53.40 0.10 960876 703660 11.94 gpg-agent
10:08:09 0 2933164 177.02 0.00 960876 703660 11.94 gpg-agent
10:09:09 0 2933164 15.62 0.00 960876 702892 11.93 gpg-agent
10:10:09 0 2933164 19.72 0.05 960876 703916 11.95 gpg-agent
10:11:09 0 2933164 174.45 0.05 960876 704172 11.95 gpg-agent
Setup
git_pillar is configured, with git_pillar_update_interval: 300
Various pillars use the gpg renderer. All other related settings are default.
Steps to Reproduce the behavior
Run the system with some encrypted pillar data and a handful of minions running highstates every 15 minutes.
Expected behavior
Memory usage should plateau once everything has started up.
Versions Report
salt --versions-report
Salt Version:
Salt: 3006.9
Python Version:
Python: 3.10.14 (main, Jun 26 2024, 11:44:37) [GCC 11.2.0]
Dependency Versions:
cffi: 1.17.1
cherrypy: unknown
cryptography: 42.0.5
dateutil: 2.8.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.4
libgit2: 1.7.2
looseversion: 1.0.2
M2Crypto: 0.38.0
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 22.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: 1.14.1
python-gnupg: 0.4.8
PyYAML: 6.0.1
PyZMQ: 23.2.0
relenv: 0.17.0
smmap: Not Installed
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: ubuntu 24.04.1 noble
locale: utf-8
machine: x86_64
release: 6.8.0-51-generic
system: Linux
version: Ubuntu 24.04.1 noblePackage: gpg-agent
Version: 2.4.4-2ubuntu17
Metadata
Metadata
Assignees
Labels
bugbroken, incorrect, or confusing behaviorcannot-reproducecannot be replicated with info/context providedmemory-leak
Activity
OrangeDog commentedon Feb 17, 2025
I currently have to restart the salt-master ~every six days to avoid unexpected OOM killings.
dmurphy18 commentedon Feb 19, 2025
Wondering if anyway related to this master memory leak #67050, understand this is 3006.9, but could be in both versions of salt-master
dmurphy18 commentedon Mar 13, 2025
@OrangeDog Wondering about if it is gpg-agent or Salt that is at fault, testing it now. But while I wait, thinking about if it is due to gpg-agent and how to prove that, or some case where Salt is not releasing something getting used in gpg-agent and hence it is holding on to memory. Also have top and htop running apart from the command that you are using.
Well ran overnight with a bash script running a highstate on the minion every two seconds with an encrypted pillar, and no increase in memory usage, pidstat for gpg-agent has remained at %MEM 0.09, HTOP is rounding up to %MEM 0.1.
Using a version of Salt branch 3006.x which should be close to what is going to be released very soon, running on updated Ubuntu 24.04.02, was using the default 60 for git_pillar_update_interval, retrying with it set to 300 but don't expect that to change much.
Any other ideas on way to reproduce, I am doing the following, master and minion on same VM
Trying to see if I can repeat the problem using my tests on 3006.9
dmurphy18 commentedon Mar 20, 2025
@OrangeDog Can you retry on the just released Salt 3006.10
OrangeDog commentedon Mar 21, 2025
Well that's vexing. I don't have many reproduction ideas.
It's still happening with 3006.10:
Is there any way to get it to be used in any different way (e.g. not left running after use)?
And in case it's at all relevant:
dmurphy18 commentedon Mar 21, 2025
So this could be the interaction of many minions with a master, but still no idea as to whether it is the salt-minion or gpg-agent that is having the leak, or if the minion is not closing some resource from the gpg-agent when it is done, the old ref count not going to zero style of issue.
Could also be the way I am accessing the encrypted pillar is different and not incurring the hit.
Can you show the way you are accessing the encrypted pillar file, event pseudo state cleaned up example, so that I can try duplicating exact conditions.
Given the infrastructure changes under Broadcom, having multiple VMs with salt-minions will be difficult to duplicate, but will try that if my current environment with your example fails to duplicate the problem.
OrangeDog commentedon Mar 23, 2025
Surely the minions have nothing to do with it, other than triggering refreshes? Pillars are rendered on the master, which is where any gpg interaction would happen.
Unless it has nothing to do with pillars, and Salt calls gpg for something else?
Most of my pillar access is via
pillar.getin map.jinja templates. There are a fewpillar['key']s in sls files andfile.managedtemplates too.20 remaining items
OrangeDog commentedon Jun 30, 2026
I've upgraded from .20 to .26 and this looks like it's been fixed.
The RSS of
gpg-agenthas not gone above 3404 after several hours.Itself had been upgraded as patches were released, and is now
2.4.4-2ubuntu17.4.dwoz commentedon Jul 1, 2026
fixed in 3006.26