mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-28 15:00:50 +00:00
Updated Rector to commit 34cdbb73b4ba988dc143cc70eec766efa81f3345
34cdbb73b4
[Doc] Add documentation for parallel troubleshooting (#2722)
This commit is contained in:
parent
8e833e3de5
commit
a6d8dc9700
32
docs/how_to_troubleshoot_parallel_issues.md
Normal file
32
docs/how_to_troubleshoot_parallel_issues.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# How to Troubleshoot Parallel Issues
|
||||
|
||||
You may get some parallel errors and ask how you can identify if there is something in your code or a real parallel issue than can be fixed by configuration. They may be displayed as:
|
||||
|
||||
```bash
|
||||
$ ./vendor/bin/rector process
|
||||
...
|
||||
[ERROR] Could not process "/app/vendor/rector/rector/vendor/symplify/easy-parallel/src/ValueObject/ParallelProcess.php" file, due to: "Child process timed out after 120 seconds". On line: 103
|
||||
[ERROR] Could not process some files, due to: "Reached system errors count limit of 50, exiting...".
|
||||
```
|
||||
|
||||
When that happens, the first good approach is to disable parallel processing. The output of parallel failures can hide some fatal errors from the source codebase. You can do so by:
|
||||
|
||||
```php
|
||||
$rectorConfig->disableParallel();
|
||||
```
|
||||
|
||||
After that, if rector processing works fine, that is an indication that you might need to adjust your parallel process to some balanced load, depending on the resources you have to process rector.
|
||||
|
||||
|
||||
If we check [parallel() method defaults](https://github.com/rectorphp/rector-src/blob/main/packages/Config/RectorConfig.php#L53):
|
||||
```php
|
||||
public function parallel(int $seconds = 120, int $maxNumberOfProcess = 16, int $jobSize = 20) : void
|
||||
```
|
||||
|
||||
You might find it helpful to keep it aligned with what you have at your disposal:
|
||||
|
||||
- timeout `$seconds` can be increased if you find your codebase has a job size with classes that require more time to process, and then you need more time to process
|
||||
- `$maxNumberOfProcess` may be decreased not to overload your system, and keeping some processes free and avoid side impacts of busy systems not being able to process files properly. For example: if you have four processes, you can use `$maxNumberOfProcess = 2` to keep two processes free and limit the system load.
|
||||
- `$jobSize` might be decreased if your files have too many lines of code, which would cause more time needed to process, which also will load the processes, etc
|
||||
|
||||
Happy coding!
|
|
@ -17,12 +17,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'c19b953b849e12a67e506c536f9dedaf6c9185cb';
|
||||
public const PACKAGE_VERSION = '34cdbb73b4ba988dc143cc70eec766efa81f3345';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-07-30 01:29:40';
|
||||
public const RELEASE_DATE = '2022-07-30 07:38:16';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInite92d87d742b0d7702597a18ce9a2fae9::getLoader();
|
||||
return ComposerAutoloaderInit01674148983560959bd3558181c34cbd::getLoader();
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInite92d87d742b0d7702597a18ce9a2fae9
|
||||
class ComposerAutoloaderInit01674148983560959bd3558181c34cbd
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,19 +22,19 @@ class ComposerAutoloaderInite92d87d742b0d7702597a18ce9a2fae9
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInite92d87d742b0d7702597a18ce9a2fae9', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit01674148983560959bd3558181c34cbd', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite92d87d742b0d7702597a18ce9a2fae9', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit01674148983560959bd3558181c34cbd', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite92d87d742b0d7702597a18ce9a2fae9::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit01674148983560959bd3558181c34cbd::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInite92d87d742b0d7702597a18ce9a2fae9::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit01674148983560959bd3558181c34cbd::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequiree92d87d742b0d7702597a18ce9a2fae9($fileIdentifier, $file);
|
||||
composerRequire01674148983560959bd3558181c34cbd($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
@ -46,7 +46,7 @@ class ComposerAutoloaderInite92d87d742b0d7702597a18ce9a2fae9
|
|||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequiree92d87d742b0d7702597a18ce9a2fae9($fileIdentifier, $file)
|
||||
function composerRequire01674148983560959bd3558181c34cbd($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInite92d87d742b0d7702597a18ce9a2fae9
|
||||
class ComposerStaticInit01674148983560959bd3558181c34cbd
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
|
@ -3407,9 +3407,9 @@ class ComposerStaticInite92d87d742b0d7702597a18ce9a2fae9
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite92d87d742b0d7702597a18ce9a2fae9::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite92d87d742b0d7702597a18ce9a2fae9::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInite92d87d742b0d7702597a18ce9a2fae9::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit01674148983560959bd3558181c34cbd::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit01674148983560959bd3558181c34cbd::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit01674148983560959bd3558181c34cbd::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user