-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Make sure the instance is in maintenance mode before reseting opcache… #34143
Make sure the instance is in maintenance mode before reseting opcache… #34143
Conversation
… and upgrading. Signed-off-by: Mateus de Lima Oliveira <mateus@ativarsoft.com>
99eb3df
to
ba8e8b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 makes sense
@@ -973,10 +973,10 @@ public static function handleRequest() { | |||
self::checkMaintenanceMode($systemConfig); | |||
|
|||
if (\OCP\Util::needUpgrade()) { | |||
if (function_exists('opcache_reset')) { | |||
opcache_reset(); | |||
} | |||
if (!((bool) $systemConfig->getValue('maintenance', false))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I reading that wrong or is that if the instance is NOT in maintenance mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!false === true
I think it is correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction, confused, but you are right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe come was right here, the false
is just the default, so this reads
$maintenanceEnabled = $systemConfig->getValue('maintenance', false);
if (!$maintenanceEnabled) {
}
This makes sense since the printUpgradePage
will get called if an upgrade needs to be ran but hasn't started yet (that enabled maintenance mode).
I'm not sure this change even makes sense, needUpgrade
only returns true if the source has been upgraded, but the nextcloud upgrade hasn't ran yet. So the instance is already "down" in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No offense intended @ativarsoft , I realize the gif looks a bit agressive. Was supposed to be funny. The question is do you agree the |
The code and the description are both correct and I've been running that code for a while now without any problems. I changed it before the last update on stable so this code is proven to work. I should have written my description more clearly. Sorry. |
Any reason this PR is against stable24? Do we have a equivalent for master? |
closing for inactivity |
opcache_reset was being called when there is an update available but the user has not upgraded yet so the instance gets awfully slow if it can be upgraded somehow. This patch ensures that the instance is in maintenance mode. It means that the administrator of the instance is expecting and wants an upgrade.