cleanup before re-taking a freed or reassigned task

This commit is contained in:
Mike McLean 2008-11-19 11:03:15 -05:00
parent d96b27ca35
commit cd4c5f0b28

View file

@ -853,6 +853,12 @@ class TaskManager(object):
for task in tasks:
# note: tasks are in priority order
self.logger.debug("task: %r" % task)
if self.tasks.has_key(task['id']):
# we were running this task, but it apparently has been
# freed or reassigned. We can't do anything with it until
# updateTasks notices this and cleans up.
self.logger.debug("Task %(id)s freed or reassigned", task)
continue
if task['state'] == koji.TASK_STATES['ASSIGNED']:
self.logger.debug("task is assigned")
if self.host_id == task['host_id']: