Skip to content

Commit

Permalink
Merge pull request #9398 from gndk/grpc-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 25, 2023
2 parents 59e549d + fd2b439 commit 99a69b4
Showing 1 changed file with 11 additions and 1 deletion.
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

0 comments on commit 99a69b4

Please sign in to comment.