[8.x] Revert isDownForMaintenance function to use file_exists() #36889
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After updating one of our applications to Laravel 8.x, we noticed a recurring issue with our queue workers after deployments. When we would run
php artisan queue:restart
during the deployment process, the worker processes would restart as expected, but they would no longer work jobs from the queue.After some investigation, we determined this issue was specifically occurring because our deployment script executes
php artisan queue:restart
while the application is still in maintenance mode. It appeared that even after we brought the application out of maintenance mode, theisDownForMaintenance
check from within the worker processes was still returningtrue
.It appears the issue was introduced in this PR, which would explain why we never encountered this issue prior to updating to Laravel 8.x. We believe the issue is related to differences in how the statcache is utilized between
is_file()
andfile_exists()
.Steps to reproduce issue
php artisan queue:work
command.php artisan down
to bring the application into maintenance mode.php artisan queue:restart
to restart the queue worker.php artisan up
to bring the application out of maintenance mode.