Bug 15254

Summary: Koha/Plack runs in endless loop if mysql is down
Product: Koha Reporter: Wolfram Schneider <wosch>
Component: DatabaseAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: abl, jonathan.druart, tomascohen
Version: 3.20   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Wolfram Schneider 2015-11-25 15:36:00 UTC
Hi,

I'm running koha-common_3.20.04 with plack enabled.

I noticed that the CPU runs at 100% if the mysql service is down. Looking in the logfiles it seems that starman starts a /etc/koha/plack.psgi process, and if it fails try it again.

here is the apache error log output:

DBI connect('dbname=koha_koha;host=localhost;port=3306','koha_koha',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/DBIx/Connector.pm line 32.
Error while loading /etc/koha/plack.psgi: Can't call method "do" on unblessed reference at /usr/share/koha/lib/C4/Context.pm line 793.
Compilation failed in require at /usr/share/koha/lib/C4/Letters.pm line 27.
BEGIN failed--compilation aborted at /usr/share/koha/lib/C4/Letters.pm line 27.
Compilation failed in require at /etc/koha/plack.psgi line 33.
BEGIN failed--compilation aborted at /etc/koha/plack.psgi line 33.

How to repeat:
on a system with plack enabled and running koha:

sudo /etc/init.d/koha-common stop
sudo /etc/init.d/mysql stop
sudo /etc/init.d/koha-common start

now check the system load with top(1)

-Wolfram
Comment 1 Jonathan Druart 2016-05-02 19:05:19 UTC
I cannot recreate the issue, Tomas could you confirm that on your side?
Comment 2 Wolfram Schneider 2016-05-03 14:13:31 UTC
I upgraded koha-common to 3.22.06 and the endless loop is gone. Thanks!