protected function removePidFileByPid(int $pid) : bool
    {
        foreach ($this->pids as $pool => $poolPids) {
            foreach ($poolPids as $workerId => $workerPid) {
                if ($pid !== $workerPid) {
                    continue;
                }
                $pidFile = $this->runPath .'/'.$pool.'/'.$pid.'.pid';
                return $this->removePidFile($pidFile);
            }
        }
        return false;
    }