LGTM, Thanks

On Wed, Dec 4, 2013 at 3:03 PM, Klaus Aehlig <[email protected]> wrote:

> When masterd was responsible for queue handling, it would, on
> restart, pick up all non-started jobs from the queue. Now that
> luxid is responsible for handling the queue, make masterd not
> do this any more.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  lib/jqueue.py | 31 -------------------------------
>  1 file changed, 31 deletions(-)
>
> diff --git a/lib/jqueue.py b/lib/jqueue.py
> index 64b6d60..cbcc381 100644
> --- a/lib/jqueue.py
> +++ b/lib/jqueue.py
> @@ -1707,11 +1707,6 @@ class JobQueue(object):
>
>      # Setup worker pool
>      self._wpool = _JobQueueWorkerPool(self)
> -    try:
> -      self._InspectQueue()
> -    except:
> -      self._wpool.TerminateWorkers()
> -      raise
>
>    def _PickupJobUnlocked(self, job_id):
>      """Load a job from the job queue
> @@ -1751,32 +1746,6 @@ class JobQueue(object):
>    def PickupJob(self, job_id):
>      self._PickupJobUnlocked(job_id)
>
> -  @locking.ssynchronized(_LOCK)
> -  @_RequireOpenQueue
> -  def _InspectQueue(self):
> -    """Loads the whole job queue and resumes unfinished jobs.
> -
> -    This function needs the lock here because WorkerPool.AddTask() may
> start a
> -    job while we're still doing our work.
> -
> -    """
> -    logging.info("Inspecting job queue")
> -
> -    all_job_ids = self._GetJobIDsUnlocked()
> -    jobs_count = len(all_job_ids)
> -    lastinfo = time.time()
> -    for idx, job_id in enumerate(all_job_ids):
> -      # Give an update every 1000 jobs or 10 seconds
> -      if (idx % 1000 == 0 or time.time() >= (lastinfo + 10.0) or
> -          idx == (jobs_count - 1)):
> -        logging.info("Job queue inspection: %d/%d (%0.1f %%)",
> -                     idx, jobs_count - 1, 100.0 * (idx + 1) / jobs_count)
> -        lastinfo = time.time()
> -
> -      self._PickupJobUnlocked(job_id)
> -
> -    logging.info("Job queue inspection finished")
> -
>    def _GetRpc(self, address_list):
>      """Gets RPC runner with context.
>
> --
> 1.8.4.1
>
>

Reply via email to