ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Killer.py
(Generate patch)

Comparing COMP/CRAB/python/Killer.py (file contents):
Revision 1.14 by spiga, Tue May 26 10:23:00 2009 UTC vs.
Revision 1.19 by spiga, Mon Jun 15 09:35:06 2009 UTC

# Line 16 | Line 16 | class Killer(Actor):
16          task = common._db.getTask(self.range)
17          toBeKilled = []
18          for job  in task.jobs:
19 <           if ( job.runningJob['status'] in ['SU','SS','R','S','SR','SW']):
19 >           if job.runningJob['state'] in ['SubSuccess','SubRequested']:
20                 toBeKilled.append(job['jobId'])
21             else:
22 <               common.logger.info("Not possible to kill Job #"+str(job['jobId'])+" : Status is "+str(job.runningJob['statusScheduler']))
22 >               common.logger.info("Not possible to kill Job #"+str(job['jobId'])+\
23 >                       " : Last action was: "+str(job.runningJob['state'])+\
24 >                       " Status is "+str(job.runningJob['statusScheduler']))
25             pass
26  
27          if len(toBeKilled)>0:
28              common.scheduler.cancel(toBeKilled)
29 +            common._db.updateRunJob_(toBeKilled, [{'state':'KillSuccess'}]*len(toBeKilled))
30 +            common._db.updateJob_(toBeKilled, [{'closed':'Y'}]*len(toBeKilled))
31              common.logger.info("Jobs killed "+str(toBeKilled))
32 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines