[mythtv-users] Ticket #9764: SBE's mythjobqueue preventing MBE idleness

Michael T. Dean mtdean at thirdcontact.com
Thu May 26 16:18:06 UTC 2011


[Switching to mythtv-users list, since you're subscribed there]

On 05/26/2011 10:32 AM, Brian J. Murrell wrote:
> [ the myth-dev posting will probably either bounce or be held in
> moderation as I am not subscribed to that list ]
>
> On 11-05-25 10:57 PM, Michael T. Dean wrote:
>> Yes.  You can either have a script start mythjobqueue and then run
>> job_queue_idle.py in a loop (with a reasonable sleep in there--maybe 5
>> or 10 minutes) until it sees 0 jobs available for processing, then kill
>> the mythjobqueue process.  Or, you can start mythjobqueue however you
>> want, and set up a cron job that runs a script that runs
>> job_queue_idle.py and, if it returns 0, kills mythjobqueue.
> OK.  As I thought.  One problem though... when mythjobqueue encounters a
> "sleeping" BE machine, which runs the mysql server it returns 1 and:
>
> Traceback (most recent call last):
>    File "bin/check_job_queue", line 74, in<module>
>      main()
>    File "bin/check_job_queue", line 39, in main
>      DB = MythDB()
>    File "/usr/lib/pymodules/python2.6/MythTV/database.py", line 958, in
> __init__
>      self.db = DBConnection(dbconn)
>    File "/usr/lib/pymodules/python2.6/MythTV/connections.py", line 150,
> in __init__
>      raise MythDBError(MythError.DB_CONNECTION, dbconn)
> MythTV.exceptions.MythDBError: Failed to connect to database at
> 'mythconverg'@'pvr'for user 'mythtv' with password '...'.
>
> The main problem being the exit code of 1, which is mistakenly
> indicating that there is 1 job in the queue.
>
> I guess an exception handler needs to be added for the:
>
>      DB = MythDB()

Yeah, I didn't test a case where the backend wasn't running/didn't 
design it for that check.  If you'd like to add a check at the beginning 
(a sort of "ping", where if it errors as above) and exit with a defined 
large-value status (like 127--which should be large enough to not 
overlap with jobcount) and modify the script on the wiki, it would be 
much appreciated.

(Also, feel free to write up better usage instructions on the 
page--possibly including any start script or cron script you've created.)

Mike


More information about the mythtv-users mailing list