Closed ash-m closed 1 year ago
any idea on if this can be merged?
Looks fine from my side as this was implemented by @brettmc. Maybe he can also confirm this changes be fine.
This looks wrong. sigterm is already stronger than sighup. the point of the sigkill is to send a stronger signal than the sigterm if the sigterm didn't work.
Please check https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html
Seems like handling SIGKILL is impossible from PHP
That is intentional. The sigkill does not allow handling, and is only sent if a graceful stop does not succeed.
I don't think changing it to SIGHUP
is correct, as that's not (usually) a terminating signal (I've often seen it used as a "restart" or "reload config" signal).
But I think it's probably correct that SIGKILL
is not worth catching, since the process should be terminated in such a way that the application doesn't get a say in it. That's certainly true in docker/k8s, but I wasn't sure that it was always true.
If SIGKILL
is not compatible with StreamSelectLoop
(I only tested against libev), then I don't see any harm in removing entirely.
just removing currently the SIGKILL. Thx all for the feedback and @ash-m for the PR. If somebody has other suggestion let me know and feel free to create a pull request.
Fix for:
From https://www.php.net/manual/en/function.pcntl-signal.php#83981 (14 years old):