You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jobs cache: keep_jobs not deleting old files #10443
Corerelates to code central or existential to Saltbugbroken, incorrect, or confusing behaviorcannot-reproducecannot be replicated with info/context providedfixed-pls-verifyfix is linked, bug author to confirm fixpending-discussionThe issue or pull request needs more discussion before it can be closed or mergedseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
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
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.
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.
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.
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!
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.
@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?
@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.
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.
@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.
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:
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.
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
Corerelates to code central or existential to Saltbugbroken, incorrect, or confusing behaviorcannot-reproducecannot be replicated with info/context providedfixed-pls-verifyfix is linked, bug author to confirm fixpending-discussionThe issue or pull request needs more discussion before it can be closed or mergedseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
basepi commentedon Feb 14, 2014
So just to verify that we're on the same page,
keep_jobs: 1means 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.
LucsT commentedon Feb 14, 2014
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.
basepi commentedon Feb 18, 2014
Well, then that's a severe bug that we need to get fixed. Thanks for the report!
cachedout commentedon Mar 3, 2014
@LucsT Just to clarify, are the files in question on the master or on the syndic?
LucsT commentedon Mar 4, 2014
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.
cachedout commentedon Mar 4, 2014
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 inmaster.pyand see if the problem becomes obvious.52 remaining items
DaveQB commentedon Dec 5, 2014
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?).
basepi commentedon Dec 5, 2014
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!
DaveQB commentedon Dec 10, 2014
@basepi That's what I said :-P
basepi commentedon Dec 15, 2014
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.
rallytime commentedon Feb 24, 2015
@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?
DaveQB commentedon Feb 24, 2015
@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
rallytime commentedon Feb 24, 2015
No problem! Thanks for the update. Keep us posted. :)
DaveQB commentedon Mar 9, 2015
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.
rallytime commentedon Mar 10, 2015
@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.
trevor-h commentedon Aug 17, 2015
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:
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
basepi commentedon Aug 18, 2015
@trevor-h When you're manually cleaning out the job cache, are there in fact jobs with a jid older than 48 hours?
frogunder commentedon Dec 15, 2015
@DaveQB, @trevor-h - Is this still an issue for you?
cachedout commentedon Dec 23, 2015
Closed for lack of response.