Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only disable grpc extension if it is not properly configured #9398

Merged
merged 1 commit into from Feb 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Psalm/Internal/Cli/Psalm.php
Expand Up @@ -44,6 +44,7 @@
use function array_values;
use function chdir;
use function count;
use function extension_loaded;
use function file_exists;
use function file_put_contents;
use function function_exists;
Expand Down Expand Up @@ -899,8 +900,17 @@ private static function restart(array $options, int $threads, Progress $progress
}
}

if ($threads > 1) {
if ($threads > 1
&& extension_loaded('grpc')
&& (ini_get('grpc.enable_fork_support') === '1' && ini_get('grpc.poll_strategy') === 'epoll1') === false
) {
$ini_handler->disableExtension('grpc');

$progress->warning(PHP_EOL
. 'grpc extension has been disabled. '
. 'Set grpc.enable_fork_support = 1 and grpc.poll_strategy = epoll1 in php.ini to enable it. '
. 'See https://github.com/grpc/grpc/issues/20250#issuecomment-531321945 for more information.'
. PHP_EOL . PHP_EOL);
}

$ini_handler->disableExtensions([
Expand Down