From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 15/27] cr-ensure-disk-space: Take the flights db lock Date: Wed, 16 Sep 2015 14:35:18 +0100 Message-ID: <1442410530-9665-16-git-send-email-ian.jackson@eu.citrix.com> References: <1442410530-9665-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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZcCsQ-0000pS-T3 for xen-devel@lists.xenproject.org; Wed, 16 Sep 2015 13:35:59 +0000 In-Reply-To: <1442410530-9665-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 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 --- 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; -- 1.7.10.4