mjphaynes / php-resque

php-resque is a Redis-backed PHP library for creating background jobs, placing them on multiple queues, and processing them later.
MIT License
221 stars 50 forks source link

workaround: child send "suicide" signal for "correct" handling in parent process #100

Closed MiRacLe-RPZ closed 3 years ago

MiRacLe-RPZ commented 3 years ago

In some situations child process hangs on shutdown phase (probably in buggy extensions) and parent process hangs in unanswered "pcntl_wait"

see https://www.php.net/manual/en/function.pcntl-fork.php#106860

xelan commented 3 years ago

Hi @MiRacLe-RPZ! Thank you very much for your PR :+1: . I'll test your implementation and include it in the upcoming 2.3 release if everything works fine. Otherwise I'll circle back and leave a note here.

MiRacLe-RPZ commented 3 years ago

"notworkaround", job was fail because pcntl_wexitstatus return non-zero...

xelan commented 3 years ago

Haha, okay... Thanks for the update :smiley: