From patchwork Thu Dec 17 17:06:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 7875141 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 202E19F32E for ; Thu, 17 Dec 2015 17:09:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64EF620444 for ; Thu, 17 Dec 2015 17:09:02 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CAEC720450 for ; Thu, 17 Dec 2015 17:08:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a9c0X-0005vi-Fr; Thu, 17 Dec 2015 17:06:25 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a9c0T-0005uD-Ry for xen-devel@lists.xenproject.org; Thu, 17 Dec 2015 17:06:21 +0000 Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id 62/D8-25435-D8BE2765; Thu, 17 Dec 2015 17:06:21 +0000 X-Env-Sender: prvs=7867bb76c=Ian.Jackson@citrix.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1450371977!11725696!3 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18199 invoked from network); 17 Dec 2015 17:06:20 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Dec 2015 17:06:20 -0000 X-IronPort-AV: E=Sophos;i="5.20,442,1444694400"; d="scan'208";a="326045257" From: Ian Jackson To: Date: Thu, 17 Dec 2015 17:06:06 +0000 Message-ID: <1450371968-27997-7-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1450371968-27997-1-git-send-email-ian.jackson@eu.citrix.com> References: <1450371968-27997-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Jackson , Ian Campbell Subject: [Xen-devel] [OSSTEST PATCH 7/9] Executive DB retry: Avoid an undefined warning X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If something other than the DB statements inside need_retry throws an exception, ->err will normally be undef (because $dbh_tests->begin_work will clear it, if nothing else). Signed-off-by: Ian Jackson Acked-by: Ian Campbell --- Osstest/JobDB/Executive.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm index 6fb77a4..c0af21c 100644 --- a/Osstest/JobDB/Executive.pm +++ b/Osstest/JobDB/Executive.pm @@ -50,7 +50,7 @@ sub begin_work ($$$) { #method sub need_retry ($$$) { my ($jd, $dbh,$committing) = @_; return - $dbh_tests->err()==7 && + ($dbh_tests->err() // 0)==7 && ($dbh_tests->state =~ m/^40P01/); # DEADLOCK DETECTED }