#NEWLINE# def processAnyUpdatedJob( self , block = 10 ) : #NEWLINE# #INDENT# '\n        Get an updated job from the batch system, blocking for up to block \n        seconds while waiting for the job. \n        ' #NEWLINE# updatedJob = self . batchSystem . getUpdatedBatchJob ( block ) #NEWLINE# if ( updatedJob is not None ) : #NEWLINE# #INDENT# ( jobBatchSystemID , exitValue , wallTime ) = updatedJob #NEWLINE# if ( self . clusterScaler is not None ) : #NEWLINE# #INDENT# issuedJob = self . jobBatchSystemIDToIssuedJob [ jobBatchSystemID ] #NEWLINE# self . clusterScaler . addCompletedJob ( issuedJob , wallTime ) #NEWLINE# #UNINDENT# if self . hasJob ( jobBatchSystemID ) : #NEWLINE# #INDENT# if ( exitValue == 0 ) : #NEWLINE# #INDENT# logger . debug ( 'Batch system is reporting that the jobWrapper with batch system ID: %s and jobWrapper store ID: %s ended successfully' , jobBatchSystemID , self . getJobStoreID ( jobBatchSystemID ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . warn ( 'Batch system is reporting that the jobWrapper with batch system ID: %s and jobWrapper store ID: %s failed with exit value %i' , jobBatchSystemID , self . getJobStoreID ( jobBatchSystemID ) , exitValue ) #NEWLINE# #UNINDENT# self . processFinishedJob ( wallTime , exitValue ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . warn ( 'A result seems to already have been processed for jobWrapper with batch system ID: %i' , jobBatchSystemID ) #NEWLINE# #UNINDENT# #UNINDENT# return updatedJob