X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=osm_mon%2Fevaluator%2Fevaluator.py;h=6ca0dc576b01ac8f82e744958aac90be869a07c6;hb=f9cb161187280335f5f1aafbf7c5120853d2ed2c;hp=d8589bb5665985936c2b046233c00e59300c9651;hpb=1c3b669e8a6030de17712758f9a81aa323d7a6d5;p=osm%2FMON.git diff --git a/osm_mon/evaluator/evaluator.py b/osm_mon/evaluator/evaluator.py index d8589bb..6ca0dc5 100644 --- a/osm_mon/evaluator/evaluator.py +++ b/osm_mon/evaluator/evaluator.py @@ -75,20 +75,30 @@ class Evaluator: # Some processes have not completed due to timeout error log.info('Some processes have not finished due to TimeoutError exception') log.debug('concurrent.futures.TimeoutError exception %s' % (e)) - Evaluator._stop_process_pool(executor) + + # Shutting down process pool executor + Evaluator._stop_process_pool(executor) @staticmethod def _stop_process_pool(executor): log.debug("_stop_process_pool") - log.info('Stopping all processes in the process pool') + log.info('Shutting down process pool') try: + log.debug('Stopping residual processes in the process pool') for pid, process in executor._processes.items(): if process.is_alive(): process.terminate() except Exception as e: log.info("Exception during process termination") log.debug("Exception %s" % (e)) - executor.shutdown() + + try: + # Shutting down executor + log.debug('Shutting down process pool executor') + executor.shutdown() + except RuntimeError as e: + log.info('RuntimeError in shutting down executer') + log.debug('RuntimeError %s' % (e)) return @staticmethod