From 20199351e66c50935b33dfa6b80b8492e2ffe325 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Tue, 31 Mar 2015 17:31:07 -0700 Subject: [PATCH] backporting #22226 to 2014.7 --- salt/utils/schedule.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py index 71d4799a32..1d403dc118 100644 --- a/salt/utils/schedule.py +++ b/salt/utils/schedule.py @@ -379,6 +379,11 @@ class Schedule(object): jobcount = 0 for basefilename in os.listdir(salt.minion.get_proc_dir(self.opts['cachedir'])): fn_ = os.path.join(salt.minion.get_proc_dir(self.opts['cachedir']), basefilename) + if not os.path.exists(fn_): + log.debug('schedule.handle_func: {0} was processed ' + 'in another thread, skipping.'.format( + basefilename)) + continue with salt.utils.fopen(fn_, 'r') as fp_: job = salt.payload.Serial(self.opts).load(fp_) if job: