From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 04/13] Planner: Fix indefinite holdoff Date: Wed, 2 Sep 2015 16:45:10 +0100 Message-ID: <1441208719-31336-5-git-send-email-ian.jackson@eu.citrix.com> References: <1441208719-31336-1-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 1ZXAEu-0000ZW-5D for xen-devel@lists.xenproject.org; Wed, 02 Sep 2015 15:46:20 +0000 In-Reply-To: <1441208719-31336-1-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: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- 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 {} { -- 1.7.10.4