Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Revert isDownForMaintenance function to use file_exists() #36889

Merged
merged 1 commit into from
Apr 6, 2021
Merged

[8.x] Revert isDownForMaintenance function to use file_exists() #36889

merged 1 commit into from
Apr 6, 2021

Conversation

codywoolsey
Copy link
Contributor

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, the isDownForMaintenance check from within the worker processes was still returning true.

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() and file_exists().

Steps to reproduce issue

  1. Setup a supervised process to run the php artisan queue:work command.
  2. Start the queue worker.
  3. Run php artisan down to bring the application into maintenance mode.
  4. Run php artisan queue:restart to restart the queue worker.
  5. Run php artisan up to bring the application out of maintenance mode.
  6. Dispatch a job onto the worker's queue. The job will never be processed.

@driesvints
Copy link
Member

Ping @GrahamCampbell

@GrahamCampbell
Copy link
Member

Fine by me. Should go to 6.x if relevant.

@taylorotwell taylorotwell merged commit 68dc7a0 into laravel:8.x Apr 6, 2021
@codywoolsey codywoolsey deleted the fix/application-maintenance-mode-check branch April 6, 2021 13:57
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.

4 participants