def _kill_workers(self, kill_timeout=2):
        for pid, sig in self._killing_sequence(kill_timeout):
            try:
                logger.debug(
                    'Killing worker {0} with signal {1}'.format(pid, sig))
                os.kill(pid, sig)
            except __HOLE__, x:
                if x.errno == errno.ESRCH:
                    logger.error('Worker with pid {0} not found'.format(pid))
                    if pid in self._workers:
                        self._workers.remove(pid)
                elif x.errno == errno.ECHILD:
                    logger.error('No alive workers left')
                    self._workers = []
                    break
                else:
                    logger.exception(
                        'Failed to kill worker {0} with signal {1}'.format(
                            pid, sig))
dataset/ETHPy150Open momyc/gevent-fastcgi/gevent_fastcgi/server.py/FastCGIServer._kill_workers