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

Maintence mode for all entry points #1377

Closed
aoldoni opened this issue Jun 17, 2015 · 3 comments
Closed

Maintence mode for all entry points #1377

aoldoni opened this issue Jun 17, 2015 · 3 comments
Assignees
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@aoldoni
Copy link
Contributor

aoldoni commented Jun 17, 2015

Hi All,

This is to discuss the scenario where cron tasks still run in Magento, even in maintenance mode.

As per the installation guidelines, you should always activate the Magento cron in the crontab ( http://devdocs.magento.com/guides/v1.0/config-guide/cli/config-cli-subcommands-cron.html ). This means adding the /bin/magento cron:run command to the crontab.

Suppose a situation where you are with Magento under maintenance mode for, let's say, 30 minutes with the intention to run a MySQL backup or run some heavy database data synchronisation script. After looking at the code, I noticed that the following entry points will fail to run as we are in maintenance mode (which is a good thing):

  • index.php
  • cron.php (public web entry point).
  • get.php
  • static.php
  • ...also API connections would fail as they all go through the \Magento\Framework\App\Bootstrap::run() and the \Magento\Framework\App\Bootstrap::assertMaintenance() methods.

However, ./bin/magento cron:run would still run, as the cli cron entry point doesn't check for maintenance mode. Please note the following steps:

vagrant@mage2:/vagrant/data/magento2$ ./bin/magento maintenance:enable
Enabled maintenance mode
vagrant@mage2:/vagrant/data/magento2$ ./bin/magento cron:run
Ran jobs by schedule.

This means that, even in maintenance mode, the crontab could still be firing database operations, and, depending on the Magento cronjob scheduled to be executed (or new custom cronjobs that were created), it could potentially trigger other heavy database operations to run in parallel with the database maintenance operations already being executed.

So, if you really need to stop all operations in your application for a brief period of time (a maintenance window), you would (a) not only put Magento in maintenance mode, but would also need to (b) deactivate the cron.

My conclusion based on the above is that it would make sense for at least the ./bin/magento cron:run command to check for the maintenance flag as well. This would be safer, and possibly assure that during maintenance mode there's nothing happening in the application.

Can you guys please point out if you share this opinion?

Thanks.

@mbrinton01
Copy link

Tracking internally as MAGETWO-38980

@vpelipenko vpelipenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jun 19, 2015
@vkorotun vkorotun removed the PS label Aug 4, 2016
@piotrekkaminski
Copy link
Contributor

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.

@amenk
Copy link
Contributor

amenk commented Feb 13, 2019

@piotrekkaminski Do you have a patch / commit where this was fixed? Looks like it is done in 2.3 develop

I saw 4c9194d but that does not look like it fixed that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

6 participants