#NEWLINE# def killBatchJobs( self , jobIDs ) : #NEWLINE# #INDENT# '\n        Kills the given jobs, represented as Job ids, then checks they are dead by checking\n        they are not in the list of issued jobs.\n        ' #NEWLINE# jobIDs = set ( jobIDs ) #NEWLINE# logger . debug ( 'Jobs to be killed: %r' , jobIDs ) #NEWLINE# for jobID in jobIDs : #NEWLINE# #INDENT# self . killQueue . put ( jobID ) #NEWLINE# #UNINDENT# while jobIDs : #NEWLINE# #INDENT# killedJobId = self . killedJobsQueue . get ( ) #NEWLINE# if ( killedJobId is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# jobIDs . remove ( killedJobId ) #NEWLINE# if ( killedJobId in self . currentJobs ) : #NEWLINE# #INDENT# self . currentJobs . remove ( killedJobId ) #NEWLINE# #UNINDENT# if jobIDs : #NEWLINE# #INDENT# logger . debug ( 'Some kills (%s) still pending, sleeping %is' , len ( jobIDs ) , sleepSeconds ) #NEWLINE# time . sleep ( sleepSeconds )