php-resque icon indicating copy to clipboard operation
php-resque copied to clipboard

Undefined variable: exitStatus

Open MiRacLe-RPZ opened this issue 3 years ago • 0 comments

                if (!pcntl_wifexited($status) or ($exitStatus = pcntl_wexitstatus($status)) !== 0) {
                    if ($this->job->getStatus() == Job::STATUS_FAILED) {
                        $this->log('Job '.$job.' failed: "'.$job->failError().'" in '.$this->job->execTimeStr(), Logger::ERROR);
                    } else {
                        $this->log('Job '.$job.' exited with code '.$exitStatus, Logger::ERROR);
                        $this->job->fail(new Exception\Dirty($exitStatus));
                    }
                }

If child process was force killed after job completition, then pcntl_wifexited return non-zero status and $exitStatus still undefined:

Undefined variable: exitStatus in vendor/mjphaynes/php-resque/src/Resque/Worker.php on line 339

MiRacLe-RPZ avatar Sep 01 '21 12:09 MiRacLe-RPZ