[Bug 9066] New: Database ping should be wrapped in an eval to avoid failures with MariaDB and Starman
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Priority: P5 - low Change sponsored?: --- Bug ID: 9066 Assignee: jcamins@cpbibliography.com Summary: Database ping should be wrapped in an eval to avoid failures with MariaDB and Starman Severity: major Classification: Unclassified OS: All Reporter: jcamins@cpbibliography.com Hardware: All Status: NEW Version: master Component: Database Product: Koha It would seem that the default timeout for MariaDB is much shorter than for MySQL, which leads to frequent connection failures under Starman. By wrapping the $dbh->ping call in an eval, Starman is able to reconnect without any problems. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Database ping should be |VirtualShelves database |wrapped in an eval to avoid |access not Plack + MariaDB |failures with MariaDB and |compatible |Starman | Severity|major |critical --- Comment #1 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- Further research has led me to conclude that the problem is *not* the ping, but rather the way the database handle is handled in VirtualShelves. $dbh must be reinitialized in each subroutine. Upping severity because now that I understand the problem I realize that this same issue could happen with MySQL. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 --- Comment #2 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- Created attachment 13422 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13422&action=edit Bug 9066: VirtualShelves db access not Plack+MariaDB compatible The $dbh database handle in C4::VirtualShelves was declared at the module level, which means under Plack it is initialized only once, when the server first starts. With the default MySQL configuration this is not a problem, since the MySQL connection does not time out, but the MariaDB default configuration does time out, resulting in every page that calls any sub in C4::VirtualShelves failing after a certain period. This patch eliminates the module-level $dbh variable and replaces it with $dbh handles in each subroutine that requires it. To test: Confirm that Virtual Shelves functionality still works as expected. The problem is not reproducible when using Apache or Plack+MySQL, but if everything works after the patch has been applied, the changes are safe. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #13422|0 |1 is obsolete| | --- Comment #3 from Mason James <mtj@kohaaloha.com> --- Created attachment 13476 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13476&action=edit Bug 9066: VirtualShelves db access not Plack+MariaDB compatible The $dbh database handle in C4::VirtualShelves was declared at the module level, which means under Plack it is initialized only once, when the server first starts. With the default MySQL configuration this is not a problem, since the MySQL connection does not time out, but the MariaDB default configuration does time out, resulting in every page that calls any sub in C4::VirtualShelves failing after a certain period. This patch eliminates the module-level $dbh variable and replaces it with $dbh handles in each subroutine that requires it. To test: Confirm that Virtual Shelves functionality still works as expected. The problem is not reproducible when using Apache or Plack+MySQL, but if everything works after the patch has been applied, the changes are safe. Signed-off-by: Mason James <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #4 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #3)
Created attachment 13476 [details] Bug 9066: VirtualShelves db access not Plack+MariaDB compatible
To test: Confirm that Virtual Shelves functionality still works as expected. The problem is not reproducible when using Apache or Plack+MySQL, but if everything works after the patch has been applied, the changes are safe.
Signed-off-by: Mason James <mtj@kohaaloha.com>
tested this on my shiny new plack+mariadb koha Virtual Shelves functionality still works as expected :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |paul.poulain@biblibre.com --- Comment #5 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: * small patch that just move a variable for better accessibility * passes koha-qa.pl * no string change * no noticeable change passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #13476|0 |1 is obsolete| | --- Comment #6 from Paul Poulain <paul.poulain@biblibre.com> --- Created attachment 13545 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13545&action=edit Bug 9066: VirtualShelves db access not Plack+MariaDB compatible The $dbh database handle in C4::VirtualShelves was declared at the module level, which means under Plack it is initialized only once, when the server first starts. With the default MySQL configuration this is not a problem, since the MySQL connection does not time out, but the MariaDB default configuration does time out, resulting in every page that calls any sub in C4::VirtualShelves failing after a certain period. This patch eliminates the module-level $dbh variable and replaces it with $dbh handles in each subroutine that requires it. To test: Confirm that Virtual Shelves functionality still works as expected. The problem is not reproducible when using Apache or Plack+MySQL, but if everything works after the patch has been applied, the changes are safe. Signed-off-by: Mason James <mtj@kohaaloha.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|master |3.10 QA Contact| |paul.poulain@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |jcamins@cpbibliography.com --- Comment #7 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 --- Comment #8 from Paul Poulain <paul.poulain@biblibre.com> --- Patch pushed to branch 3.10.x -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9066 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED --- Comment #9 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This is now working on master. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org