Bug 13699 - DBD::mysql mysql_auto_reconnect attribute ceases to function after DBIx call[s]
Summary: DBD::mysql mysql_auto_reconnect attribute ceases to function after DBIx call[s]
Status: RESOLVED DUPLICATE of bug 14778
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-12 08:52 UTC by Jacek Ablewicz
Modified: 2016-05-24 14:17 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 13669: followup to add DBIx::RunSQL dependency (1.12 KB, patch)
2016-05-24 14:12 UTC, Marc Véron
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Ablewicz 2015-02-12 08:52:18 UTC
While testing Bug 13645 patch #2, I noticed that DBIx calls apparently do interfere with DBD::mysql mysql_auto_reconnect attribute.

We have mysql auto reconnect enabled since Bug 10611, and it works fine as long as there are no DBIx calls being made - but if there is such a call in the given code, this attribute gets reseted to 0 as a side affect, disabling auto reconnect feature for all further DBI or DBIx calls being made from the same process and/or thread. E.g.:

use Modern::Perl;
use C4::Context;
use Koha::Acquisition::Bookseller;

my $dbh = C4::Context->dbh;
print "Auto reconnect: ".$dbh->{mysql_auto_reconnect}."\n";
my @booksellers = Koha::Acquisition::Bookseller->search();
print "Auto reconnect: ".$dbh->{mysql_auto_reconnect}."\n";
## $dbh->{mysql_auto_reconnect}=1;
sleep(15); ## mysqld to be reloaded in the meanwhile
@booksellers = Koha::Acquisition::Bookseller->search();

Auto reconnect: 1
Auto reconnect: 0
DBD::mysql::st execute failed: MySQL server has gone away at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1593.

At first I assumed that it may be caused by 'Bug 13645: Use DBIx::Connector', but nope, it turns out that this issue is also present in unpatched master.
Probably not such a big problem for the plain CGI setups in most typical circumstances, but lack of working auto reconnect may be quite a nuisance under plack/mod_perl.
Comment 1 Fridolin Somers 2015-06-18 12:08:02 UTC
Surely linked to Bug 14374 and Bug 14375
Comment 2 Tomás Cohen Arazi 2015-10-20 23:18:09 UTC

*** This bug has been marked as a duplicate of bug 14778 ***
Comment 3 Marc Véron 2016-05-24 14:12:59 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2016-05-24 14:17:41 UTC
Comment on attachment 51737 [details] [review]
Bug 13669: followup to add DBIx::RunSQL dependency

I mistaked with the bug number, sorry for the noise.