Skip to content

Jobs cache: keep_jobs not deleting old files #10443

Closed

Description

@LucsT

Hello,

Problem :
Jobs call with cmd_async let millions of files in directory /var/cache/salt/master/jobs/
Files seems to be never deleted. Even if I set a strict settings 'keep_jobs: 1'
Problem is more about number of files(inodes) than disk space for me.

I have a syndic with about 200 minions.
I see the number of files growth with X*Y where X:number of minions in this syndic Y: jobs launched

Versions (minion, syndic, master) are:
Salt: 0.17.5
Python: 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
Jinja2: 2.5.5
M2Crypto: 0.20.1
msgpack-python: 0.1.10
msgpack-pure: Not Installed
pycrypto: 2.1.0
PyYAML: 3.09
PyZMQ: 13.1.0
ZMQ: 3.2.3

Not very familar with erlang, only solution I found to avoid problem is to manually erase file jobs.
Tell me if anything else is welcome.

Lucas

Activity

  1. basepi commented on Feb 14, 2014

    @basepi
    Contributor

    So just to verify that we're on the same page, keep_jobs: 1 means that the master will keep jobs for one hour. Are you seeing files in the cache older than one hour? There may be a bug/edge case in the cleanup routines that we need to fix.

    If you're just generating too many inodes per hour (unlikely, but possible) then I would recommend looking into an external job cache.

  2. added this to the milestone on Feb 14, 2014
  3. LucsT commented on Feb 14, 2014

    @LucsT
    Author

    Yes I mean my jobs cache files stay forever. So cache older than 'keep_jobs' hours is not deleted.
    I tested default (I read in doc is 24h), 2h , 1h.

  4. basepi commented on Feb 18, 2014

    @basepi
    Contributor

    Well, then that's a severe bug that we need to get fixed. Thanks for the report!

  5. modified the milestones: Outstanding Bugs, on Feb 18, 2014
  6. cachedout commented on Mar 3, 2014

    @cachedout
    Contributor

    @LucsT Just to clarify, are the files in question on the master or on the syndic?

  7. LucsT commented on Mar 4, 2014

    @LucsT
    Author

    Both

    I see the problem on syndic first. Because partition is more tiny.
    Now I erase periodically the cache with cron. Even in my Master of master.

    I remember the Inodes growth too on the Master of master.

    Any complement, I launch command using cmd_async. Then I take the return with get_cli_return.
    Maybe the cache cleaning doesn't work only with that kind of call.

  8. cachedout commented on Mar 4, 2014

    @cachedout
    Contributor

    OK. I can't replicate this all on v2014.1. I will try again on v17.5.

    The cache cleaner shouldn't have anything to do with the type of call. It runs as a part of the main master event loop and simply cleans up job directories older than a certain time.

    If you're handy with Python, you could start putting some debug statements in the _clear_old_jobs() function in master.py and see if the problem becomes obvious.

  9. 52 remaining items

  10. DaveQB commented on Dec 5, 2014

    @DaveQB
    Contributor

    I haven't forgot about this, but with Xmas coming up and my leave starting soon, I won't be upgrading until the new year (2015.1 maybe?).

  11. basepi commented on Dec 5, 2014

    @basepi
    Contributor

    I think you meant 2015.1? The version will actually likely be 2014.12, however. We want to feature freeze in just a couple of weeks. =) Guess we'll see!

  12. DaveQB commented on Dec 10, 2014

    @DaveQB
    Contributor

    @basepi That's what I said :-P

  13. basepi commented on Dec 15, 2014

    @basepi
    Contributor

    Hehe, I wish Github would show history on comment edits. =P Anyway, our current tentative feature freeze is this Wednesday, but it may be pushed off a week.

  14. rallytime commented on Feb 24, 2015

    @rallytime
    Contributor

    @DaveQB - Just a bump here. Several releases have come out on the 2014.7 branch since this was last discussed. Are you still seeing this issue? Did you get a change to test?

  15. DaveQB commented on Feb 24, 2015

    @DaveQB
    Contributor

    @rallytime Sorry to stretch this out. We haven't upgraded since this issue arose and relying on cronjobs as a work around. The ticket to start the upgrade process has floated to near the top of my list, so it shouldn't be long now.

    Thanks

  16. rallytime commented on Feb 24, 2015

    @rallytime
    Contributor

    No problem! Thanks for the update. Keep us posted. :)

  17. DaveQB commented on Mar 9, 2015

    @DaveQB
    Contributor

    We tried the upgrade to 2014.7.1 and that ended in a disaster as you are aware of from other issues we have conversed on @rallytime . We have successfully rolled back to 2014.1.3. I hope 2015 works for us, so we can upgrade and I can re-test for this issue.

    So this ticket will stay open a little while longer I am afraid.

  18. rallytime commented on Mar 10, 2015

    @rallytime
    Contributor

    @DaveQB No problem. Apologies that the upgrade has caused so much strife. Hopefully the multi-master issues we have discussed on other tickets are resolved and the upgrade goes more smoothly.

  19. added
    Core
    on Apr 8, 2015
  20. trevor-h commented on Aug 17, 2015

    @trevor-h
    Contributor

    I seem to have encountered this issue on a testing salt-master. We have several 2014.7.x salt-masters in production with keep_jobs: 48 and 100% of jobs being async and have never seen this issue.

    With a 2015.5.1 salt-master we have just seen this issue for the first time. Same scenario with keep_jobs at 48 and 100% async jobs. Inode output from df:

    Filesystem Inodes IUsed IFree IUse% Mounted on
    /dev/vda1 1966080 1966080 0 100% /

    Seems the salt-master is using > 75% of the available inodes and I've had to resort to manually cleaning out the job cache. Could be a fluke or something fixed in a later 2015.5 but I figure it's worth noting as relevant to this issue.

    Versions report below:

           Salt: 2015.5.1
         Python: 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
         Jinja2: 2.7.3
       M2Crypto: 0.22
    

    msgpack-python: 0.4.6
    msgpack-pure: Not Installed
    pycrypto: 2.6.1
    libnacl: Not Installed
    PyYAML: 3.10
    ioflo: Not Installed
    PyZMQ: 14.6.0
    RAET: Not Installed
    ZMQ: 4.0.5
    Mako: Not Installed

  21. basepi commented on Aug 18, 2015

    @basepi
    Contributor

    @trevor-h When you're manually cleaning out the job cache, are there in fact jobs with a jid older than 48 hours?

  22. frogunder commented on Dec 15, 2015

    @frogunder
    Contributor

    @DaveQB, @trevor-h - Is this still an issue for you?

  23. cachedout commented on Dec 23, 2015

    @cachedout
    Contributor

    Closed for lack of response.

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

    Corebugcannot-reproducefixed-pls-verifypending-discussionseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions