Skip to content

[Turbo] Fix crash cache due to PHPStan turbo - #8850

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-turbo-config-hash-property-order
Oct 26, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
fix-turbo-config-hash-property-order

Conversation

@samsonasik

Copy link
Copy Markdown
Member

Ref #8812 (comment)

I tested rector/rector:2.8.0 on CodeIgniter4 project, and somehow got crash:

{"fatal_errors":["Unable to delete directory '/tmp/rector/77/0

it is working ok on 2.7.0. Step to reproduce:

git clone https://github.com/codeigniter4/CodeIgniter4.git
cd CodeIgniter4
composer require --dev rector/rector:2.8.0
vendor/bin/rector

Turbo makes the parallel workers compute a different config hash than the main process, so each run's workers wipe the shared cache concurrently and race each other.

This PR fix it /cc @SanderMuller

@samsonasik

Copy link
Copy Markdown
Member Author

Fixed 🎉 /cc @SanderMuller

@samsonasik

Copy link
Copy Markdown
Member Author

@TomasVotruba ready 👍

@TomasVotruba

Copy link
Copy Markdown
Member

Nice work 👍

@TomasVotruba
TomasVotruba merged commit 16d43af into main Oct 26, 2026
50 checks passed
@TomasVotruba
TomasVotruba deleted the fix-turbo-config-hash-property-order branch October 26, 2026 13:00
@TomasVotruba

TomasVotruba commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Also, can you add this as CI Workflow here? So we can catch it a bit earlier next time :)

it is working ok on 2.7.0. Step to reproduce:

@samsonasik

Copy link
Copy Markdown
Member Author

I will try 👍

@SanderMuller

Copy link
Copy Markdown
Contributor

Awesome @samsonasik !

@SanderMuller

Copy link
Copy Markdown
Contributor

The workers still run the configuration check when they boot, and each of them can clear the shared cache. If the main process and the workers differ in some other way, the race comes back. I can open a small PR so that only the main process runs this check.

@TomasVotruba

Copy link
Copy Markdown
Member

@SanderMuller That would be great 👍 Please cover via CI workflow with a standalone compiled Rector (rector/rector) run on some small project.

@SanderMuller

Copy link
Copy Markdown
Contributor

@SanderMuller That would be great 👍 Please cover via CI workflow with a standalone compiled Rector (rector/rector) run on some small project.

Perfect, PR is up, adding CI workflow to it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants