PDA

View Full Version : MySQLHelper



Triode
2006-06-17, 05:08
Dan,

I've been noticing problems with the server not starting up after a power failure.

Problem appears to be mysql going through a crash recovery routine at startup and hence not accepting connections when slimserver
trys to connect to it.
I'd like to propose the following which I think means that the 10 sec loop for database startup waits for the database to be
accepting connections, rather than just running.

Does it look OK. Must say I've not extensively tested the problem case..

--- Slim/Utils/MySQLHelper.pm (revision 8023)
+++ Slim/Utils/MySQLHelper.pm (working copy)
@@ -175,7 +175,7 @@
# Give MySQL time to get going..
for (my $i = 0; $i < 10; $i++) {

- last if -r $class->pidFile && $proc->alive;
+ last if -r $class->pidFile && $proc->alive && $class->dbh;
sleep 1;
}

Adrian