Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9732 closed Patch - Feature (Invalid)

Added retry when database connection fails

Reported by: jorcas33@… Owned by:
Priority: minor Milestone: unknown
Component: MythTV - General Version: 0.24-fixes
Severity: medium Keywords:
Cc: Ticket locked: no


Even setting the proper boot priority order, I see mythtv user starting before mysql server is ready, so mythwelcome somethimes fails connecting to the database (even it is local) and it asks again for configuration.

This patch added in libmyth/mythcontext.cpp just try to connect again to the database (only 12 retry) after waiting 10 seconds.

Attachments (1)

mythtv-0.24.1.patch (958 bytes) - added by jorcas33@… 10 years ago.
patch on mythcontext.cpp

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by jorcas33@…

Attachment: mythtv-0.24.1.patch added

patch on mythcontext.cpp

comment:1 Changed 10 years ago by robertm

Resolution: Invalid
Status: newclosed

Adding a random, ten second long sleep that will negatively 99.99% of users (by making them wait tens of seconds before failing) isn't going to be something we can apply here, IMO.

Why not wrap your start of myth with a check of pidof mysqld?

comment:2 Changed 10 years ago by sphery

And we already have functionality allowing MythTV to attempt to wait for the MySQL server to start (and, use WOL to start it, if desired). This can be enabled in your config.xml or mysql.txt. See "Enable database server wakeup" in the "Configure Manually" section of (the second screen of) the "Please select default MythTV Backend Server" dialog shown with mythfrontend -p . "Enable database server wakeup" will enable DB host WOL/waiting for the DB host to wake (and note that if you're just waiting, you can use "echo 'Waiting for database server." as your "Wake command").

Note: See TracTickets for help on using tickets.