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

Reconnect to DB after timeout for Notify command. Fixes #14479 #14480

Merged
merged 3 commits into from
Mar 4, 2019

Conversation

ariselseng
Copy link
Member

@ariselseng ariselseng commented Mar 3, 2019

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:

protected function reconnectToDatabase(OutputInterface $output) {

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.

Signed-off-by: Ari Selseng <ari@selseng.net>
@MorrisJobke MorrisJobke added this to the Nextcloud 16 milestone Mar 4, 2019
@MorrisJobke
Copy link
Member

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>
@ariselseng
Copy link
Member Author

@MorrisJobke woops. Done!

Signed-off-by: Ari Selseng <ari@selseng.net>
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good 👍

@rullzer rullzer merged commit 243bc96 into nextcloud:master Mar 4, 2019
@icewind1991
Copy link
Member

/backport to stable15

@icewind1991
Copy link
Member

/backport to stable14

@backportbot-nextcloud
Copy link

backport to stable15 in #15006

@backportbot-nextcloud
Copy link

backport to stable14 in #15007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants