コード例 #1
0
ファイル: main.py プロジェクト: Medium/ClusterRunner
 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)
コード例 #2
0
ファイル: main.py プロジェクト: OspreyX/ClusterRunner
 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)
コード例 #3
0
 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)
コード例 #4
0
ファイル: main.py プロジェクト: ojammeh/ClusterRunner
 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)
コード例 #5
0
    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())
コード例 #6
0
    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))