Skip to content

fix possible rector internal timeout when processing large apps#406

Merged
LordSimal merged 1 commit into
5.xfrom
5.x-fix-timeout
Jun 30, 2026
Merged

fix possible rector internal timeout when processing large apps#406
LordSimal merged 1 commit into
5.xfrom
5.x-fix-timeout

Conversation

@LordSimal

@LordSimal LordSimal commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

While doing another check if the current 6.0 rector rules properly apply on the core I noticed, that rector times out internally.

This fixes this issue. Unfortunately there is no global rector config for this present which can be applied across all ruleset (at least as far as I and my AI agent know)

@samsonasik thoughts?

Specifically I am talking about this error:

[ERROR] Could not process                                                      
         "/Users/kevin/Documents/CakePHP/Org/upgrade/vendor/rector/rector/vendor
         /symplify/easy-parallel/src/ValueObject/ParallelProcess.php" file, due 
         to:                                                                    
         "Child process timed out after 120 seconds". On line: 96               

 [ERROR] Could not process some files, due to:                                  
         "Reached system errors count limit of 50, exiting...".                 

Something went wrong while running rector.

This happened to me while using the 6.x of this branch and doing a

bin/cake upgrade rector --rules cakephp60 /Users/kevin/Documents/CakePHP/Org/cakephp/src

where /Users/kevin/Documents/CakePHP/Org/cakephp is on the current 5.x branch state.

Therefore I tried to apply all rules from the CakePHP 6.0 ruleset to the whole core framework at once

Comment thread config/rector/authentication40.php Outdated
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->parallel(600);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also reduce job size, eg:

    $rectorConfig->parallel(600, 32, 10);

job size is basically how many files that needs to be processed per worker.

ref documentation

https://getrector.com/documentation/troubleshooting-parallel#content-configure-parallel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case just increasing the timeout did the job, so I'd like to keep the default value here as you guys probably had reasons to choose those in the first place :D

Comment thread config/rector/cakephp40.php Outdated
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->parallel(600);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can import "global" config, eg:

$rectorConfig->import(__DIR__ . '/default-rector.php');

so you only change 1 default file if needed.

@LordSimal LordSimal merged commit 46f0708 into 5.x Jun 30, 2026
3 checks passed
@LordSimal LordSimal deleted the 5.x-fix-timeout branch June 30, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants