[Koha-bugs] [Bug 13699] New: DBD::mysql mysql_auto_reconnect attribute ceases to function after DBIx call[s]

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 12 09:52:18 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13699

            Bug ID: 13699
           Summary: DBD::mysql mysql_auto_reconnect attribute ceases to
                    function after DBIx call[s]
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: gmcharlt at gmail.com
          Reporter: abl at biblos.pk.edu.pl
        QA Contact: testopia at bugs.koha-community.org

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.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list