#NEWLINE# def kill_processes( self ) : #NEWLINE# #INDENT# 'Gets called on shutdown by the timer when too much time has gone by,\n        calling the terminate method instead of nicely asking for the consumers\n        to stop.\n\n        ' #NEWLINE# LOGGER . critical ( 'Max shutdown exceeded, forcibly exiting' ) #NEWLINE# processes = True #NEWLINE# while processes : #NEWLINE# #INDENT# processes = self . active_processes #NEWLINE# for proc in processes : #NEWLINE# #INDENT# if ( int ( proc . pid ) != int ( os . getpid ( ) ) ) : #NEWLINE# #INDENT# LOGGER . warning ( 'Killing %s (%s)' , proc . name , proc . pid ) #NEWLINE# os . kill ( int ( proc . pid ) , signal . SIGKILL ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOGGER . warning ( 'Cowardly refusing kill self (%s, %s)' , proc . pid , os . getpid ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# time . sleep ( 0.5 ) #NEWLINE# #UNINDENT# LOGGER . info ( 'Killed all children' ) #NEWLINE# return self . set_state ( self . STATE_STOPPED )