Skip to content

Try Rector: dev-main with enable parallel #6841

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

Closed

Conversation

samsonasik
Copy link
Member

this PR is only to verify if latest dev-main resolve the parallel issue on system dir.

@samsonasik
Copy link
Member Author

@paulbalandan @MGatner increase timeout seems resolve it.

@MGatner
Copy link
Member

MGatner commented Nov 12, 2022

Excellent!! This is on my list to try in a project today too. Looks good for here though. Did you want to go with dev-main for now? Or is this a POC until the next Rector release?

@samsonasik
Copy link
Member Author

This is just for testing, we can wait until next Rector release 👍

@paulbalandan
Copy link
Member

Setting to 240s timeout seems not to work for me on Windows.

$ vendor/bin/rector process --dry-run --clear-cache
  80/754 [==>-------------------------]  10%
                                                                                                                        
 [ERROR] Could not process "C:\Users\P\Desktop\Web                                                                      
         Dev\CodeIgniter4\vendor\rector\rector\vendor\symplify\easy-parallel\src\ValueObject\ParallelProcess.php" file, 
         due to:                                                                                                        
         "Child process timed out after 240 seconds". On line: 103                                                      



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

But,

diff --git a/rector.php b/rector.php
index 300688f62..fcba58e9f 100644
--- a/rector.php
+++ b/rector.php
@@ -60,7 +60,7 @@ return static function (RectorConfig $rectorConfig): void {
         PHPUnitSetList::REMOVE_MOCKS,
     ]);

-    $rectorConfig->parallel(240);
+    $rectorConfig->parallel(240, 8, 1);

     // paths to refactor; solid alternative to CLI arguments

where 8 is the value of nproc, and 1 is the job size

$ vendor/bin/rector process --dry-run --clear-cache
 754/754 [============================] 100%

                                                                                                                        
 [OK] Rector is done!

@samsonasik
Copy link
Member Author

@paulbalandan thank you for verify, that probably the trick 👍 , that's documented on https://github.com/rectorphp/rector/blob/main/docs/how_to_troubleshoot_parallel_issues.md

We can update to that config with set number of process and job size on next release 👍

@MGatner
Copy link
Member

MGatner commented Nov 13, 2022

I went to test and had to rebuild Docker (unless Rector actually took it down 🤔). I will try again, but it looks like we have enough feedback to move forward.

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.

3 participants