Summary: | VirtualShelves database access not Plack + MariaDB compatible | ||
---|---|---|---|
Product: | Koha | Reporter: | Jared Camins-Esakov <jcamins> |
Component: | Database | Assignee: | Jared Camins-Esakov <jcamins> |
Status: | CLOSED FIXED | QA Contact: | Paul Poulain <paul.poulain> |
Severity: | critical | ||
Priority: | P5 - low | CC: | jcamins, mtj, paul.poulain |
Version: | 3.10 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 9066: VirtualShelves db access not Plack+MariaDB compatible
Bug 9066: VirtualShelves db access not Plack+MariaDB compatible Bug 9066: VirtualShelves db access not Plack+MariaDB compatible |
Description
Jared Camins-Esakov
2012-11-13 03:08:30 UTC
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. Created attachment 13422 [details] [review] 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. Created attachment 13476 [details] [review] 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> (In reply to comment #3) > Created attachment 13476 [details] [review] > 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 :) QA comment: * small patch that just move a variable for better accessibility * passes koha-qa.pl * no string change * no noticeable change passed QA Created attachment 13545 [details] [review] 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> This patch has been pushed to master. Patch pushed to branch 3.10.x This is now working on master. |