[mythtv] [PATCH] prevent JobQueue::ProcessQueue from claiming all available jobs

Aran Cox spin667 at mchsi.com
Thu May 26 04:57:56 UTC 2005


Currently ProcessQueue will call ClaimJob on all available jobs in the
queue.  This means that if you have another backend that is limited to
running jobs during a certain window it will only have a chance to
operate on those jobs created during that window.  I'm assuming that's
not the desired behaviour.  

I noticed this because I scheduled a ton of HD recordings for
transcoding but my slave backend (which can only run jobs from 2-7 AM,
because otherwise it might need all it's horsepower for playing HD
programs) never processed any of them.  It took my master backend DAYS
to churn through all of them.

Anyway, I all I did was move the "if (startedJobAlready)" check up a
little bit.  This doesn't seem to break anything at all and generally
causes a given back end to start one job and process that before
claiming any more.

-------------- next part --------------
--- mythtv-0.18-acc-fixes/libs/libmythtv/jobqueue.cpp	2005-04-10 00:33:06.000000000 -0500
+++ mythtv-release-0-18-fixes/libs/libmythtv/jobqueue.cpp	2005-05-23 13:21:39.000000000 -0500
@@ -422,6 +422,11 @@
                     continue;
                 }
 
+                // never start more than one job at a time
+                // also avoid ClaimJob'ing more than one job per run as well
+                if (startedJobAlready)
+                    continue;
+
                 if ((inTimeWindow) &&
                     (hostname == "") &&
                     (!ClaimJob(id)))
@@ -445,10 +450,6 @@
                     continue;
                 }
 
-                // never start more than one job at a time
-                if (startedJobAlready)
-                    continue;
-
                 message = QString("JobQueue: Processing '%1' job for chanid "
                                   "%2 @ %3, current status is '%4'")
                                   .arg(JobText(type))


More information about the mythtv-dev mailing list