[Bug 14600] New: MySQL server has gone away
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 Bug ID: 14600 Summary: MySQL server has gone away Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: gmcharlt@gmail.com Reporter: olli-antti.kivilahti@jns.fi QA Contact: testopia@bugs.koha-community.org After introducing the Koha::Object and DBIx features: We have had serious issues with MySQL/MariaDB losing the DB connection, throwing just the cryptic "MySQL server has gone away" error, after ~5 minutes of connection inactivity. This seriously affects all daemonized Perl-processes we use with C4::Context, like the SIP2-server and Plack and the Mojolicious REST API. DBIx-layer of DB handle negotiation works fine detecting a stale connection, but the new connection generation is delegated to DBI (this is inefficient duplication). DBI-layer doesn't detect a stale connection and for us (LXC v1.03, Ubuntu 12/14.04) the "mysql_auto_reconnect"-parameter doesn't work. Our improvement targets the C4::Context->dbh(); <<SNIP if ( defined($context->{db_driver}) && $context->{db_driver} eq 'mysql' && $context->{"dbh"} ) { return $context->{"dbh"}; } elsif ( defined($context->{"dbh"}) && $context->{"dbh"}->ping() ) { return $context->{"dbh"}; } SNAP>> #This prevents the $dbh->ping() from ever getting called: if ( defined($context->{db_driver}) && $context->{db_driver} eq 'mysql' && $context->{"dbh"} ) { #because $context->{dbh} is true even if the connection is dead. #Obviously this relies on the "mysql_auto_reconnect"-parameter which doesn't #work. This patch adds a timer to ping every 4 minutes to see if the connection is still alive, regardless of the DB we use (MySQL/MariaDB vs ...). Pinging every 4 minutes shouldn't make a performance dent, but makes it possible for us to operate our SIP2-server without restarting it every 5 minutes. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41152 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41152&action=edit Bug 14600 - MySQL server has gone away -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14374 CC| |abl@biblos.pk.edu.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14375 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13699 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #2 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- We had those logs workings with perl persistence. Please see Bug 14375. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 --- Comment #3 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41248 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41248&action=edit Bug 14600 - MySQL server has gone away -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41152|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14600 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Resolution|--- |DUPLICATE Status|NEW |RESOLVED --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Olli, with bug 14778, this issue should be fixed. Please reopen if it persists after 3.22. *** This bug has been marked as a duplicate of bug 14778 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org