xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [OSSTEST v1.1 PATCH 2.1/3] Executive database: Handle 40001 "SERIALIZATION FAILURE" too
Date: Fri, 2 Dec 2016 16:21:36 +0000	[thread overview]
Message-ID: <1480695696-3670-1-git-send-email-ian.jackson@eu.citrix.com> (raw)

This can happen if the locks are removed, which we are about to do.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/JobDB/Executive.pm | 3 ++-
 tcl/JobDB-Executive.tcl    | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 557cee1..c3fd449 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -54,7 +54,8 @@ sub need_retry ($$$) {
     my ($jd, $dbh,$committing) = @_;
     return
 	($dbh_tests->err() // 0)==7 &&
-	($dbh_tests->state =~ m/^40P01/); # DEADLOCK DETECTED
+	($dbh_tests->state =~ m/^(?:40P01|40001)/);
+    # DEADLOCK DETECTED or SERIALIZATION FAILURE
 }
 
 sub current_flight ($) { #method
diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index 6225bd9..6eb43f6 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -382,8 +382,9 @@ proc transaction {tables script {autoreconnect 0}} {
 	db-close
 	if {$rc} {
 	    switch -glob $errorCode {
-		{OSSTEST-PSQL * 40P01} {
-		    # DEADLOCK DETECTED
+		{OSSTEST-PSQL * 40P01} -
+		{OSSTEST-PSQL * 40001} {
+		    # DEADLOCK DETECTED or SERIALIZATION FAILURE
 		    db-execute ROLLBACK
 		    logputs stdout "transaction deadlock ($result) retrying ..."
 		    if {[incr retries -1] <= 0} {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

                 reply	other threads:[~2016-12-02 16:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480695696-3670-1-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).