Skip signal handler registration when pcntl functions are disabled#508
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2826d300e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ( | ||
| ! extension_loaded('pcntl') || | ||
| ! function_exists('pcntl_async_signals') || | ||
| ! function_exists('pcntl_signal') |
There was a problem hiding this comment.
Guard unregister path when pcntl_signal is disabled
When pcntl_signal is disabled but the pcntl extension is loaded, this new guard makes registerSignalHandlers() return, but start() still runs the finally block and unregisterSignalHandlers() only checks extension_loaded('pcntl') before calling pcntl_signal. In the shared-hosting configuration this change is meant to support, the crawl still fatals at shutdown with an undefined/disabled pcntl_signal; mirror the guard there or track whether handlers were actually registered before unregistering.
Useful? React with 👍 / 👎.
|
Thanks for the fix, @poldixd! Good catch on shared hosting where |
This merge request fixes an issue on shared hosting.
The crawler checked if the pcntl extension is loaded, but on some shared servers the extension is loaded while the needed functions are disabled.
Because of that, the crawler tried to call pcntl_async_signals() and failed with an error.