#NEWLINE# def stop( self , cluster ) : #NEWLINE# #INDENT# logger . info ( 'Shutting down ES cluster' ) #NEWLINE# stop_watch = self . _clock . stop_watch ( ) #NEWLINE# stop_watch . start ( ) #NEWLINE# for node in cluster . nodes : #NEWLINE# #INDENT# process = node . process #NEWLINE# node . telemetry . detach_from_node ( node ) #NEWLINE# os . kill ( process . pid , signal . SIGINT ) #NEWLINE# try : #NEWLINE# #INDENT# process . wait ( 10.0 ) #NEWLINE# logger . info ( ( 'Done shutdown node (%.1f sec)' % stop_watch . split_time ( ) ) ) #NEWLINE# #UNINDENT# except subprocess . TimeoutExpired : #NEWLINE# #INDENT# logger . warn ( ( 'Server %s did not shut down itself after 10 seconds; now kill -QUIT node, to see threads:' % node . node_name ) ) #NEWLINE# try : #NEWLINE# #INDENT# os . kill ( process . pid , signal . SIGQUIT ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# logger . warn ( '  no such process' ) #NEWLINE# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# process . wait ( 120.0 ) #NEWLINE# logger . info ( ( 'Done shutdown node (%.1f sec)' % stop_watch . split_time ( ) ) ) #NEWLINE# return #NEWLINE# #UNINDENT# except subprocess . TimeoutExpired : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# logger . info ( 'kill -KILL node' ) #NEWLINE# try : #NEWLINE# #INDENT# process . kill ( ) #NEWLINE# #UNINDENT# except ProcessLookupError : #NEWLINE# #INDENT# logger . warn ( 'No such process' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# cluster . telemetry . detach_from_cluster ( cluster ) #NEWLINE# self . _servers = [ ]