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.8 by spiga, Mon May 12 15:53:35 2008 UTC vs.
Revision 1.18 by spiga, Fri Jun 12 15:03:01 2009 UTC

# Line 12 | Line 12 | class Killer(Actor):
12          """
13          The main method of the class: kill a complete task
14          """
15 <        common.logger.debug(5, "Killer::run() called")
15 >        common.logger.debug( "Killer::run() called")
16          task = common._db.getTask(self.range)
17          toBeKilled = []
18          for job  in task.jobs:
19 <           # if id not in  common._db.nJobs("list"):
20 <           #     common.logger.message("Warning: job # "+str(id)+" doesn't exists! Not possible to kill it.")
21 <           # else:
22 <           if ( job.runningJob['status'] in ['SS','R','S']):
19 >           if job.runningJob['state'] in ['SubSuccess','SubRequest']:
20                 toBeKilled.append(job['jobId'])
21             else:
22 <               common.logger.message("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.logger.message("Jobs killed "+str(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