[cups.bugs] [BUG] cannot set JobRetryInterval in cups-1.3.9

Michael R Sweet msweet at apple.com
Wed Feb 4 13:30:02 PST 2009


Michael R Sweet wrote:
> Jeff Chua wrote:
>> Michael,
>>
>> I think I've tracked down the problem. It seems there's a 10 seconds
>> wait injected into the select() code in schedule/main.c that's causing
>> cupsd to sleep for an additional 10 seconds even if there's active job
>> to retry.
>>
>> So, if the interval is 3 seconds, it'll attempt to make it 13 seconds
>> before retries.
>>
>> Here's a patch to fix the problem. This will make the retries at
>> "closer" to the interval specified.
> 
> Um, your patch will do bad things for performance and power management
> (not sleeping as much).  Better to just look for held jobs and set the
> select timeout accordingly.
> 
> Will look into it some more...

OK, this should do it better:

Index: scheduler/main.c
===================================================================
--- scheduler/main.c	(revision 8329)
+++ scheduler/main.c	(working copy)
@@ -1925,15 +1925,20 @@
    * Check for any active jobs...
    */

-  if (timeout > (now + 10) && ActiveJobs)
+  if (cupsArrayCount(ActiveJobs) > 0)
    {
      for (job = (cupsd_job_t *)cupsArrayFirst(ActiveJobs);
  	 job;
  	 job = (cupsd_job_t *)cupsArrayNext(ActiveJobs))
-      if (job->state_value <= IPP_JOB_PROCESSING)
+      if (job->state_value == IPP_JOB_HELD && job->hold_until < timeout)
        {
+        timeout = job->hold_until;
+	why     = "release held jobs";
+      }
+      else if (job->state_value == IPP_JOB_PENDING && timeout > (now + 10))
+      {
  	timeout = now + 10;
-	why     = "process active jobs";
+	why     = "start pending jobs";
  	break;
        }
    }



-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups mailing list