'Kill a worker
:attr pid: int, worker pid
:attr sig: `signal.SIG*` value'

def kill_worker(self, pid, sig):

    try:
        os.kill(pid, sig)
    except OSError as e:
        if (e.errno == errno.ESRCH):
            try:
                worker = self.WORKERS.pop(pid)
                worker.tmp.close()
                self.cfg.worker_exit(self, worker)
                return
            except (KeyError, OSError):
                return
        raise
