From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTEST PATCH 15/27] cr-ensure-disk-space: Take the flights db lock Date: Wed, 16 Sep 2015 15:13:56 +0100 Message-ID: <1442412836.18856.86.camel@citrix.com> References: <1442410530-9665-1-git-send-email-ian.jackson@eu.citrix.com> <1442410530-9665-16-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZcDTE-00047Y-Kd for xen-devel@lists.xenproject.org; Wed, 16 Sep 2015 14:14:00 +0000 In-Reply-To: <1442410530-9665-16-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-16 at 14:35 +0100, Ian Jackson wrote: > This eliminates the race with cs-bisection-step (and other > flight-construction tools which might reuse previous flights, provided > that they also do not pass previous flight numbers from hand to hand > with the db unlocked). > > Signed-off-by: Ian Jackson Acked-by: Ian Campbell > --- > cr-ensure-disk-space | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space > index 8c5a708..138f3f4 100755 > --- a/cr-ensure-disk-space > +++ b/cr-ensure-disk-space > @@ -145,10 +145,13 @@ END > return 1; > } > > -for (;;) { > - iteration_continue() > - or last; > -} > +db_retry($dbh_tests,[qw(flights)], sub { > + @flights = (); > + for (;;) { > + iteration_continue() > + or last; > + } > +}); > > printf "ok.\n"; > exit 0;