Skip to content

[10.x] Fix file race condition after view:cache and artisan up - #48368

Merged
taylorotwell merged 4 commits into
laravel:10.xfrom
roxik:files-race-condition
Sep 13, 2023
Merged

[10.x] Fix file race condition after view:cache and artisan up#48368
taylorotwell merged 4 commits into
laravel:10.xfrom
roxik:files-race-condition

Conversation

@roxik

@roxik roxik commented Sep 12, 2023

Copy link
Copy Markdown
Contributor

This PR will fix error with file race condition after call php artisan view:cache and php artisan up.

Case php artisan up:

User has request, passed condition if ($this->app->maintenance Mode()->active()) then file framework/down deleted by command and then in file_get_contents we have ErrorException.

Solution: recheck file exists

image

Case php artisan view:cache:

Same conditions, but instead file_get_contents we have filemtime

@roxik roxik changed the title fix file race condition after view:cache and artisan up [10.x] fix file race condition after view:cache and artisan up Sep 12, 2023
@roxik roxik changed the title [10.x] fix file race condition after view:cache and artisan up [10.x] Fix file race condition after view:cache and artisan up Sep 12, 2023
@taylorotwell

Copy link
Copy Markdown
Member

Please remove all textual formatting / spacing changes made to docblocks and mark as ready for review again when complete. Thanks.

@taylorotwell
taylorotwell marked this pull request as draft September 12, 2023 21:27
@roxik
roxik marked this pull request as ready for review September 12, 2023 22:43
Comment thread src/Illuminate/Contracts/Foundation/MaintenanceMode.php Outdated
Comment thread src/Illuminate/Filesystem/Filesystem.php Outdated
Comment thread src/Illuminate/Foundation/FileBasedMaintenanceMode.php Outdated
Comment thread src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php Outdated
Comment thread src/Illuminate/View/Compilers/Compiler.php Outdated
roxik and others added 2 commits September 13, 2023 11:47
…gMaintenance.php

Co-authored-by: Dries Vints <dries@vints.be>
@roxik

roxik commented Sep 13, 2023

Copy link
Copy Markdown
Contributor Author

@driesvints resolved

@roxik
roxik requested a review from driesvints September 13, 2023 08:56
@taylorotwell
taylorotwell merged commit bfa85b8 into laravel:10.x Sep 13, 2023
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