Don't reset active bit when setting status to "Abort". The scheduler needs that information to know if the queue entry was active before being aborted.
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2436 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/models.py b/frontend/afe/models.py
index ad95b1e..3384ab0 100644
--- a/frontend/afe/models.py
+++ b/frontend/afe/models.py
@@ -700,7 +700,7 @@
'Failed', 'Stopped', string_values=True)
ABORT_STATUSES = (Status.ABORT, Status.ABORTING, Status.ABORTED)
ACTIVE_STATUSES = (Status.STARTING, Status.VERIFYING, Status.PENDING,
- Status.RUNNING, Status.ABORT, Status.ABORTING)
+ Status.RUNNING, Status.ABORTING)
COMPLETE_STATUSES = (Status.PARSING, Status.ABORTED, Status.COMPLETED,
Status.FAILED, Status.STOPPED)
@@ -738,7 +738,11 @@
def _set_active_and_complete(self):
- if self.status in self.ACTIVE_STATUSES:
+ if self.status == self.Status.ABORT:
+ # must leave active flag unchanged so scheduler knows if entry was
+ # active before abort.
+ return
+ elif self.status in self.ACTIVE_STATUSES:
self.active, self.complete = True, False
elif self.status in self.COMPLETE_STATUSES:
self.active, self.complete = False, True