salt: [BUG] Memory leak in salt-master version 3000.2

Description

After an upgrade to 3000.2 for the security fixes on 30/4/2020, the memory usage of the salt-master simply keeps growing exponentially.

Setup

  • Local filesystem based roots for pillars and states. No GitFS or external git pillars involved. I am explicitly mentioning this since gitfs has memory leak issues already because of pygit2.

Screenshots

image

Versions Report

Salt Version:
           Salt: 3000.2

Dependency Versions:
           cffi: 1.12.3
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
         Jinja2: 2.10
        libgit2: 0.27.3
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.27.3
         Python: 3.6.9 (default, Apr 18 2020, 01:56:04)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-74-generic
         system: Linux
        version: Ubuntu 18.04 bionic

Note: The usage drop in above screenshot indicates salt-master restarts.

Debugging

From what I have been able to dig so far, it looks like the memory consumption keeps growing for the publisher process in particular.

 [salt.transport.zeromq:903 ][INFO    ][10938] Starting the Salt Publisher on tcp://[::]:4505

The above PID from logfile is the one whose memory usage keeps growing. I will try to dig further if I get the chance but dropping this issue here so that anyone with further insight can help.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 39 (18 by maintainers)

Most upvoted comments

I can confirm this: 3002.1+ds-1 (Ubuntu 18.04 and Ubuntu 16.04)

Have restart salt-master service every night…

This still happens with 3002.1+ds-1 (Debian 9).

For the record, I still see it on 3003.1 .
image

3002.2 fixed 100% CPU usage but I’m still seeing memory usage at 100% which eventually presents itself in the logs as gpg render cannot allocate. Should I open a new issue?

@JPerkster yes, please upgrade to 3002.2

I have the same issue. Can someone have a solution for this? The bug is already open for a few months. Thanks