[mythtv] Odd Job Queue Behavior

Brad Benson bbenso1 at gmail.com
Tue Apr 26 20:34:59 UTC 2005


I've noticed some slightly odd behavior from the job queue.  It's not
really a functionality thing so much as a status display thing. 
Basically, if there is a single job running in the job queue, when it
completes the status gets set to JOB_FINISHED.  However, if that job
completes and there are still other jobs being run (on any backend)
the status gets set to JOB_STOPPING and stays that way until ALL jobs
are complete.  As soon as there are no longer any active jobs in the
queue all completed jobs get set to JOB_FINISHED.

I noticed this because I've been trying to get nuvexport to run from
the jobqueue (and update the job comment field with progress info). 
I've pretty much got it working, but nuvexport tends to run for
several hours on each export.  When I'm running an export the mythweb
job queue status section gets filled with commflag jobs in
JOB_STOPPING state.  So if the export takes 4 hours and myth records
30 minute shows throughout that entire span I end up with 8 commflag
entries with a status of JOB_STOPPING and the status page gets very
cluttered.

Again, this doesn't seem to effect functionality at all, it just makes
the status page very cluttered.  I'm digging into the jobqueue code
today to see if I can find where and why this is happening, but if
anyone has any tips on where to look I'd appreciate it.

What I've found so far is that mythcommflag seems to set the status to
JOB_STOPPING when it has completed and the FlagCommercialsThread seems
to set the status to JOB_FINISHED after the call to myth_system
returns.  It seems to me that myth_system should return almost
immediately after mythcommflag completes so I'm not sure yet why the
status isn't updated until no jobs are running in the queue.

Brad


More information about the mythtv-dev mailing list