Merge pull request #346 from dokime7/master

Fix concurrency handling in order to avoid that some workers get the same task at the same time.
This commit is contained in:
mdipierro
2014-01-14 22:17:34 -08:00
+2 -2
View File
@@ -912,10 +912,10 @@ class Scheduler(MetaScheduler):
)
if not task.task_name:
d['task_name'] = task.function_name
task.update_record(**d)
db((st.id==task.id) & (st.status.belongs((QUEUED, ASSIGNED)))).update(**d)
db.commit()
wkgroups[gname]['workers'][myw]['c'] += 1
db.commit()
#I didn't report tasks but I'm working nonetheless!!!!
if x > 0:
self.empty_runs = 0