Skip to content

Can't disable Job Cache? #29286

Closed
Closed

Description

@harlanbarnes

Hi - First off, thanks for all everyone does on this software! It is greatly appreciated.

My issue is that we seem to be unable to disable our job cache. Our salt version is:

salt 2015.5.4 (Lithium)

Our master configuration looks like this:

worker_threads: 10
open_mode: True
job_cache: False
keep_jobs: 0
fileserver_backend:
  - git
gitfs_provider: gitpython
gitfs_remotes:
  - git+ssh://[email protected]/notourrealcompany/salt.git
gitfs_base: master
pillar_roots:
  base:
    - /srv/pillar

My process to recreate is:

  • Stop the salt-master process
  • Remove all directories in /var/cache/salt/master/jobs
  • Start up the salt-master process
  • Lots of directories/uuids/jids return to the /var/cache/salt/master/jobs directory

Our use case here is that we have similar symptoms to #10443 and we don't see (or don't currently understand) what the job cache provides us. We've filled up our disk a couple of times and were looking for a more permanent solution than adding a cron task to remove older files in the cache.

Thanks again!

Harlan

Activity

  1. Grokzen commented on Dec 1, 2015

    @Grokzen

    I have seen the same problem kinda. I see alot of the following files that fills up the disk and takes up alot of inodes.

    e0/bd421bb48fb37bebd0f0223ed3c90b           
    e0/bd421bb48fb37bebd0f0223ed3c90b/.load.p   
    e0/bd421bb48fb37bebd0f0223ed3c90b/jid       
    e0/bd421bb48fb37bebd0f0223ed3c90b/.minions.p
    

    Another thing i have noticed is that when the master jobs cache contains all of these files, restarting the sale master takes 1h or more before it starts becuase there is some sanity check at startup that goes through all files in the jobs cache and itterating over all those files takes forever.

  2. added
    bug
    severity-medium
    Core
    P1
    on Dec 1, 2015
  3. added this to the Approved milestone on Dec 1, 2015
  4. jfindlay commented on Dec 1, 2015

    @jfindlay
    Contributor

    @harlanbarnes, @Grokzen, thanks for reporting. It seems that some more tuning needs to be provided for the master job cache, and possibly other salt auditing mechanisms.

  5. self-assigned this
    on Dec 1, 2015
  6. jakehilton commented on Jan 5, 2016

    @jakehilton

    I'm also seeing this with 2015.8.3. Seems to ignore the job cache settings and fills up inodes until the system is unusable.

  7. removed their assignment
    on Jan 5, 2016
  8. rallytime commented on May 17, 2016

    @rallytime
    Contributor

    Hi all - After looking over this issue, I think what is happening here is a badly-documented option via the job_cache boolean. We can't "turn off" the functionality of creating jid directories in the /var/cache/salt/master/jobs/ directory because Salt uses those directories to check for jid collisions.

    What setting job_cache: False does is simply throw away the returns, but keeps the jids. So setting this value to False will reduce the size of the jid dirs, but won't disable their existence completely.

    One thing you can do to reduce the size of the job cache dir is to set the cache cleaner to clean more regularly. You can do this by setting the keep_jobs option to 1. (Note that the keep_jobs option cannot be 0, or the local_cache.clean_old_jobs function will not run.)

    I think at the very least the docs for the job_cache option needs to be updated.

  9. rallytime commented on May 17, 2016

    @rallytime
    Contributor

    Oh, also after testing the keep_jobs setting, the cache cleaner does remove the jid files from the jid dirs, but it doesn't remove the original directory that was created in /var/cache/salt/master/jobs/.

    For example (note that job_cache is set to the default of True in this case, and that jid dir 30 has been cleaned, but the newest job, 19, has not been cleaned yet):

    root@rallytime:~# ls /var/cache/salt/master/jobs/
    19  26  30  51  91  92  d5  d6
    root@rallytime:~# ls /var/cache/salt/master/jobs/30/
    root@rallytime:~# ls /var/cache/salt/master/jobs/19/
    f1cca89613752b2fb9a65b1450bec7
    

    That particular behavior is a bug and should be fixed.

  10. modified the milestones: C 10, Approved on May 17, 2016
  11. self-assigned this
    on May 17, 2016
  12. added a commit that references this issue on May 17, 2016
    c28e4dd
  13. rallytime commented on May 17, 2016

    @rallytime
    Contributor

    @harlanbarnes I think the responses above, as well as my fix in #3328 should help alleviate the troubles you're having with the job_cache option. Please let me know if you have any questions or suggestions.

  14. added
    fixed-pls-verify
    on May 17, 2016
  15. harlanbarnes commented on May 18, 2016

    @harlanbarnes
    Author

    Hi @rallytime - Thanks so much for looking into my issue! Yes, I think this will do it. Again, I appreciate all the work the Salt team does! - hb

  16. rallytime commented on May 18, 2016

    @rallytime
    Contributor

    Excellent! Glad to hear it. :)

  17. added 2 commits that reference this issue on May 19, 2016
    4fdb097
    336fbb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CoreP1Returnersbugfixed-pls-verifyseverity-medium

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions