-
-
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
Reconnect to DB after timeout for Notify command. Fixes #14479 #14480
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Ari Selseng <ari@selseng.net>
MorrisJobke
reviewed
Mar 4, 2019
MorrisJobke
reviewed
Mar 4, 2019
Mind to add the sign-off message to your last commit: https://github.com/nextcloud/server/pull/14480/checks?check_run_id=72120851 |
Signed-off-by: Ari Selseng <ari@selseng.net>
30ee9bf
to
3218e0f
Compare
@MorrisJobke woops. Done! |
kesselb
requested changes
Mar 4, 2019
Signed-off-by: Ari Selseng <ari@selseng.net>
icewind1991
approved these changes
Mar 4, 2019
MorrisJobke
approved these changes
Mar 4, 2019
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.
Code looks good 👍
/backport to stable15 |
/backport to stable14 |
backport to stable15 in #15006 |
backport to stable14 in #15007 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix #14479
Every 8th hour I got a "2006 Mysql server has gone away". It was due to a 8 hour wait_time.
Since the Notify command should be running 24/7 increasing wait_time won't help much. Change events that triggers this never get registered and filecache will be wrong/out of sync.
This PR makes it reconnect in case of timeout. I borrowed the reconnect logic from:
server/apps/files/lib/Command/Scan.php
Line 300 in 1cfa870
I also needed to move updateQuery to a method due to it being a prepared statement from a dead connection and it needed to be remade after reconnect.