Closed koschos closed 6 years ago
RulerZ\Compiler\FileEvaluator is going to fail on race condition (concurrent writes). Consider the following situation. https://github.com/K-Phoen/rulerz/blob/master/src/Compiler/FileEvaluator.php
Thread 1 is writing file content, but not finished yet (L25) Thread 2 is checking if the file exists (L24), gets true and requires the file (L28) while writing process is not finished (Thread 1), which leads to Fatal.
Possible solutions are:
Thanks for reporting the issue (and well done finding it!)
I wrote a fix (see the PR #100) which is released in the version 0.20.5
RulerZ\Compiler\FileEvaluator is going to fail on race condition (concurrent writes). Consider the following situation. https://github.com/K-Phoen/rulerz/blob/master/src/Compiler/FileEvaluator.php
Thread 1 is writing file content, but not finished yet (L25) Thread 2 is checking if the file exists (L24), gets true and requires the file (L28) while writing process is not finished (Thread 1), which leads to Fatal.
Possible solutions are: