magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.59k stars 9.32k forks source link

Move magento2 maintenance flag to separate folder #36585

Open ByJacob opened 1 year ago

ByJacob commented 1 year ago

Description

When running magento2 on several servers, some of the files must be shared. Unfortunately, the var directory may contain various elements that must be shared between store instances. Therefore, it is impossible to set the var/.maintenance.flag file to not be shared by an instance. Currently, when we have several servers with a shared var directory, when we turn on maintenance mode on one (e.g., when doing a Blue/Green deployment) the other stores also turned on maintenance mode.

Expected behavior

The .maintenance.flag file marking the maintenance mode is located in a separate folder, such as var/flags/.maintenance.flag or allowing this path to be configured via the CLI.

Benefits

Making it easier when running multiple magento2 nodes. This will make it easier to separate the folder to be stored locally only.

Additional information

The folder for this file must be changed: https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/App/MaintenanceMode.php#L33

Release note

Separate the maintenance flag .maintenance.flag into a separate var/flags folder. This way, only this folder from the var folder can be set as local in case of architecture with several magento2 servers.

m2-assistant[bot] commented 1 year ago

Hi @ByJacob. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel