yandextank/plugins/ShootExec/plugin.py
def __terminate(self):
        """Gracefull termination of running process"""

        if self.__stderr_file:
            self.__stderr_file.close()

        if not self.__process:
            return

        waitfor = time.time() + _PROCESS_KILL_TIMEOUT
        while time.time() < waitfor:
            try:
                self.__process.terminate()
            except EnvironmentError as e:
                if e.errno != errno.ESRCH:
                    _LOGGER.warning("Failed to terminate process '{}': {}".format(self.__cmd, e))
                return
            time.sleep(0.1)

        try:
            self.__process.kill()
        except EnvironmentError as e:
            if e.errno != errno.ESRCH:
                _LOGGER.warning("Failed to kill process '{}': {}".format(self.__cmd, e))
            return
def __terminate(self):
        """Gracefull termination of running process"""

        if self.__stderr_file:
            self.__stderr_file.close()

        if not self.__process:
            return

        waitfor = time.time() + _PROCESS_KILL_TIMEOUT
        while time.time() < waitfor:
            try:
                self.__process.terminate()
            except EnvironmentError as e:
                if e.errno != errno.ESRCH:
                    _LOGGER.warning("Failed to terminate process '{}': {}".format(self.__cmd, e))
                return
            time.sleep(0.1)

        try:
            self.__process.kill()
        except EnvironmentError as e:
            if e.errno != errno.ESRCH:
                _LOGGER.warning("Failed to kill process '{}': {}".format(self.__cmd, e))
            return
def __terminate ( self ) : if self . __stderr_file : self . __stderr_file . close ( ) if not self . __process : return waitfor = time . time ( ) + _PROCESS_KILL_TIMEOUT while time . time ( ) < waitfor : try : self . __process . terminate ( ) except EnvironmentError as e : if e . errno != errno . ESRCH : _LOGGER . warning ( "Failed to terminate process '{}': {}" . format ( self . __cmd , e ) ) return time . sleep ( 0.1 ) try : self . __process . kill ( ) except EnvironmentError as e : if e . errno != errno . ESRCH : _LOGGER . warning ( "Failed to kill process '{}': {}" . format ( self . __cmd , e ) ) return
Gracefull termination of running process
Gracefull termination of running process