def log_app_debug_info_and_force_kill_after_delay(): time.sleep(seconds) logger = log.get_logger(__name__) logger.error('ClusterRunner did not exit within {} seconds. App debug info:\n\n{}.', seconds, app_info.get_app_info_string()) logger.critical('ClusterRunner seems to be hanging unexpectedly. Hard killing the process. Farewell!') os._exit(1)
def log_app_debug_info_and_force_kill_after_delay(): time.sleep(seconds) logger = log.get_logger(__name__) logger.error('ClusterRunner did not exit within {} seconds. App debug info:\n\n{}.', seconds, app_info.get_app_info_string()) logger.critical('ClusterRunner seems to be hanging unexpectedly. Sending SIGKILL to self. Farewell!') os.kill(os.getpid(), signal.SIGKILL)
def log_app_debug_info_and_force_kill_after_delay(): time.sleep(seconds) logger = log.get_logger(__name__) logger.error( 'ClusterRunner did not exit within {} seconds. App debug info:\n\n{}.', seconds, app_info.get_app_info_string()) logger.critical( 'ClusterRunner seems to be hanging unexpectedly. Hard killing the process. Farewell!' ) os._exit(1)
def log_app_debug_info_and_force_kill_after_delay(): time.sleep(seconds) logger = log.get_logger(__name__) logger.error( 'ClusterRunner did not exit within {} seconds. App debug info:\n\n{}.', seconds, app_info.get_app_info_string()) logger.critical( 'ClusterRunner seems to be hanging unexpectedly. Sending SIGKILL to self. Farewell!' ) os.kill(os.getpid(), signal.SIGKILL)
def _application_info_dump_signal_handler(self, sig, frame): """ A signal handler that will dump application info to the logs. :param sig: Signal number of the received signal :type sig: int :param frame: The interrupted stack frame :type frame: frame """ self._logger.info('{} signal received. Dumping application info.', self._signal_names[sig]) self._logger.notice(app_info.get_app_info_string())
def _application_info_dump_signal_handler(self, sig, frame): """ A signal handler that will dump application info to the logs. :param sig: Signal number of the received signal :type sig: int :param frame: The interrupted stack frame :type frame: frame """ self._logger.info('{} signal received. Dumping application info.', self._signal_names[sig]) app_info_string = app_info.get_app_info_string() self._logger.notice(app_info_string) with open(self._SIGINFO_DEBUG_LOG, 'a') as f: f.write("{}\n".format(app_info_string))