Bug 15254 - Koha/Plack runs in endless loop if mysql is down
Summary: Koha/Plack runs in endless loop if mysql is down
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: 3.20
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-25 15:36 UTC by Wolfram Schneider
Modified: 2016-12-05 21:22 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

Note You need to log in before you can comment on or make changes to this bug.
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!