Skip to content

max_event_size seems broken #23883

Closed
Closed

Description

@kaithar

I'm not sure exactly what's not working here, but I suspect it's the config parsing system specifically not finding max_event_size in my master config file. Okie, this is what the docs say (and this is in the example master config):

# Passing very large events can cause the minion to consume large amounts of
# memory. This value tunes the maximum size of a message allowed onto the
# master event bus. The value is expressed in bytes.
#max_event_size: 1048576

So I set my config value...

max_event_size: 104857600

And it does nothing. To illustrate I made the following changes:

--- a/salt/minion.py
+++ b/salt/minion.py
@@ -819,6 +819,7 @@ class Minion(MinionBase):
         if beacons:
             self._fire_master(events=beacons)
             for beacon in beacons:
+                log.debug('mes @ minion: '+self.opts.get('max_event_size', 'missing'))
                 serialized_data = salt.utils.dicttrim.trim_dict(
                     self.serial.dumps(beacon['data']),
                     self.opts.get('max_event_size', 1048576),
--- a/salt/utils/event.py
+++ b/salt/utils/event.py
@@ -493,6 +493,7 @@ class SaltEvent(object):
         data['_stamp'] = datetime.datetime.utcnow().isoformat()

         tagend = TAGEND
+        log.debug('mes @ event: '+self.opts.get('max_event_size', 'missing'))
         serialized_data = salt.utils.dicttrim.trim_dict(
             self.serial.dumps(data),
             self.opts.get('max_event_size', 1048576),

The result.... lots and lots of

[DEBUG ] mes @ event: missing

I don't know nearly enough about the way the config system is setup to be able to fix this, but it's pretty much a show stopper for anyone wanting to exceed that 1M limit ... it's basically nuking my pillar data when it grows past 1M and I've resorted to disabling the trim test completely:

--- a/salt/utils/dicttrim.py
+++ b/salt/utils/dicttrim.py
@@ -46,7 +46,8 @@ def trim_dict(
         dict_size = sys.getsizeof(data)
     else:
         dict_size = sys.getsizeof(serializer.dumps(data))
-    if dict_size > max_dict_bytes:
+    if False:
+        #if dict_size > max_dict_bytes:
         if is_msgpacked:
             data = serializer.loads(data)
         while True:

Activity

  1. rallytime commented on May 20, 2015

    @rallytime
    Contributor

    Thanks for the report @kaithar. Can you also post the output of salt --versions-report for historical purposes? That will also help us debug.

  2. added
    bug
    severity-medium
    Core
    P3
    on May 20, 2015
  3. added this to the Approved milestone on May 20, 2015
  4. kaithar commented on May 20, 2015

    @kaithar
    ContributorAuthor

    Seems --versions-report has hard dep on nacl... will install.

  5. kaithar commented on May 20, 2015

    @kaithar
    ContributorAuthor
    Salt Version:
               Salt: 2015.5.0-1314-g31680c7
    
    Dependency Versions:
             Jinja2: 2.7.3
           M2Crypto: 0.22
               Mako: Not Installed
             PyYAML: 3.11
              PyZMQ: 14.6.0
             Python: 2.7.8 (default, Oct 20 2014, 15:05:19)
               RAET: 0.6.3
                ZMQ: 4.0.5
              ioflo: 1.2.1
            libnacl: 1.4.2
       msgpack-pure: Not Installed
     msgpack-python: 0.4.5
           pycrypto: 2.6.1
    
    System Versions:
               dist: Ubuntu 15.04 vivid
            machine: x86_64
            release: 3.8.0-21-generic
             system: Ubuntu 15.04 vivid
    

    (I'm running against develop, last commit pulled appears to be 31680c7)

  6. kaithar commented on May 20, 2015

    @kaithar
    ContributorAuthor

    When I restarted the minion on my master I noticed an additional confirmation that the problem seems to be specific to the master ... the minion appears to get a number in salt/utils/event.py while the master gets the default "missing" string I gave it. I'll double check what the minion is seeing after lunch.

  7. msteed commented on May 20, 2015

    @msteed
    Contributor

    Verified that the master config value is being parsed and saved but then apparently lost. Investigating...

  8. added
    Confirmed
    on May 20, 2015
  9. added a commit that references this issue on May 20, 2015
  10. added a commit that references this issue on May 21, 2015
  11. added a commit that references this issue on May 22, 2015
    bfd812c
  12. added
    fixed-pls-verify
    on May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfirmedCoreP3bugfixed-pls-verifyseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions