From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTEST PATCH 04/13] Planner: Fix indefinite holdoff Date: Thu, 3 Sep 2015 11:51:06 +0100 Message-ID: <1441277466.26292.340.camel@citrix.com> References: <1441208719-31336-1-git-send-email-ian.jackson@eu.citrix.com> <1441208719-31336-5-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZXS6o-0002l9-0l for xen-devel@lists.xenproject.org; Thu, 03 Sep 2015 10:51:10 +0000 In-Reply-To: <1441208719-31336-5-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-09-02 at 16:45 +0100, Ian Jackson wrote: > runneeded-ensure-will would always reset the runneeded_holdoff_after > timer. So no new queue run would start until no runneeded-ensure-will > has occurred for (currently) 30s. > > Instead, only start the timer if it's not already running. > > Signed-off-by: Ian Jackson Acked-by: Ian Campbell > --- > ms-queuedaemon | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/ms-queuedaemon b/ms-queuedaemon > index d6d59ee..1aa526c 100755 > --- a/ms-queuedaemon > +++ b/ms-queuedaemon > @@ -86,10 +86,12 @@ proc runneeded-ensure-will {need} { > log-event "runneeded-ensure-will $need (was $need_queue_run)" > > if {$need > $need_queue_run} { set need_queue_run $need } > - catch { after cancel $runneeded_holdoff_after } > - set runneeded_holdoff_after \ > - [after [expr {$c(QueueDaemonHoldoff) * 1000}] \ > - runneeded-perhaps-start] > + > + if {![info exists runneeded_holdoff_after]} { > + set runneeded_holdoff_after \ > + [after [expr {$c(QueueDaemonHoldoff) * 1000}] \ > + runneeded-perhaps-start] > + } > } > > proc runneeded-perhaps-start {} {