Opened 14 years ago
Closed 14 years ago
Last modified 14 years ago
#9732 closed Patch - Feature (Invalid)
Added retry when database connection fails
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | MythTV - General | Version: | 0.24-fixes |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
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)
Change History (3)
Changed 14 years ago by
Attachment: | mythtv-0.24.1.patch added |
---|
comment:1 Changed 14 years ago by
Resolution: | → Invalid |
---|---|
Status: | new → closed |
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 14 years ago by
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").
patch on mythcontext.cpp