From patchwork Fri Jul 8 18:26:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9221673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96DEB6089D for ; Fri, 8 Jul 2016 18:28:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C36A28375 for ; Fri, 8 Jul 2016 18:28:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 814CB2837F; Fri, 8 Jul 2016 18:28:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 08B5D2836F for ; Fri, 8 Jul 2016 18:28:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLaUE-0003vA-3Q; Fri, 08 Jul 2016 18:26:50 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLaUA-0003qG-Rb for xen-devel@lists.xenproject.org; Fri, 08 Jul 2016 18:26:46 +0000 Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id 4A/16-10191-660FF775; Fri, 08 Jul 2016 18:26:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRWlGSWpSXmKPExsXitHRDpG7qh/p wg9NHNC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oybWyayFUxmq1g/bTJrA+NHli5GTg4JAX+J LwdfsIPYbAK6Ek1b/rJ1MXJwiAioSNzeawBiMguESux4YQlSISyQKHHnShcziM0CVHHoy202E JtXwFNi88XFbBAT5STOH/8JVsMJFN+15CbYdCEBD4nmX02MICOFBNQk5q6Ph2gVlDg58wnYMc wCEhIHX7xghhjDLXH79FTmCYx8s5CUzUJStoCRaRWjenFqUVlqka6hXlJRZnpGSW5iZo6uoaG JXm5qcXFiempOYlKxXnJ+7iZGYDAxAMEOxqOdzocYJTmYlER59z2rDxfiS8pPqcxILM6ILyrN SS0+xCjDwaEkwcv8HignWJSanlqRlpkDDGuYtAQHj5IILyNImre4IDG3ODMdInWKUZdjwY/ba 5mEWPLy81KlxHnfvAMqEgApyijNgxsBi7FLjLJSwryMQEcJ8RSkFuVmlqDKv2IU52BUEuY9Cz KFJzOvBG7TK6AjmICOMAgAO6IkESEl1cC4+GGN+K2PXfq7J9fLNU9a8dskmaW2srxLyadyxvT pWWvLps6+NWNFFXPaRIXJG6RFJpgpSz3x3lazfOkyzbZ490ihqdb5n3hjJWeaPXV9zLImJHW3 kVbe7RfT1/ycX1DyhdOkWlJ9c7v5ot7JdpOWnp3Syfbv9fz6yUxlKit5PC77TlWbVTpdiaU4I 9FQi7moOBEAYwEZm6wCAAA= X-Env-Sender: prvs=9904f56b2=Ian.Jackson@citrix.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1468002402!52679415!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10547 invoked from network); 8 Jul 2016 18:26:45 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 8 Jul 2016 18:26:45 -0000 X-IronPort-AV: E=Sophos;i="5.28,331,1464652800"; d="scan'208";a="365150953" From: Ian Jackson To: Date: Fri, 8 Jul 2016 19:26:11 +0100 Message-ID: <1468002385-4407-20-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1468002385-4407-1-git-send-email-ian.jackson@eu.citrix.com> References: <1468002385-4407-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 19/33] tcl daemons: Move BEGIN within scope of transaction error trapping X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP If the db connection has failed, BEGIN will fail. We want to to handle this properly. Right now the effect is that we will now close the connection and it will then be reopened by the next command. Signed-off-by: Ian Jackson --- tcl/JobDB-Executive.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl index 29ab59a..f2322c4 100644 --- a/tcl/JobDB-Executive.tcl +++ b/tcl/JobDB-Executive.tcl @@ -284,8 +284,8 @@ proc transaction {tables script} { db-open while 1 { set ol {} - db-execute BEGIN set rc [catch { + db-execute BEGIN db-execute "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE" lock-tables $tables uplevel 1 $script