Description
Preconditions (*)
- Magento 2.3.x(2.3-develop too)
- Configured Build system according to technical details.
- Create own theme that extends from Magento/luma
- Magento mode is default OR developer
Steps to reproduce (*)
- Run
php bin/magento setup:static-content:deploy -f -j $(nproc)
(-j 8
in my case) with 6 different locales on build system
Expected result (*)
- We should NOT have any errors/exceptions during SCD
Actual result (*)
- Randomly we have following issue (sometimes from 4-5th time):
- Some CSS files are missing in pub/static directory
- Exception somewhere in the middle of SCD
This happening really randomly, sometimes with Magento/luma theme, sometimes with our own
File with errors:
errors.txt
Technical details
During SCD - it tries to compile LESS -> CSS files. During working on it - it tries to create lock, add some files and then unlock:
Details of these locks:
magento2/lib/internal/Magento/Framework/View/Asset/LockerProcess.php
Lines 63 to 77 in 15e3c07
and
magento2/lib/internal/Magento/Framework/View/Asset/LockerProcess.php
Lines 83 to 90 in 15e3c07
As you can see above - locking process doesn't work in production mode, but static contend deploy we're running when env.php file is not present, so by fallback it runs in "default" magento mode.
Also that's not expected to have some lock when we're running SCD in parallel, it might significantly slow down this process.
This issue was discovered during testing #22607