]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Executive database: Handle 40001 "SERIALIZATION FAILURE" too
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 2 Dec 2016 16:19:57 +0000 (16:19 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 6 Dec 2016 11:31:27 +0000 (11:31 +0000)
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
tcl/JobDB-Executive.tcl

index 76f3293bdd28122e4985a7f2a066616629e7854e..91247bdf7432237f0e70176e7f795da15e126817 100644 (file)
@@ -51,7 +51,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
index 6225bd9b53a1ec95f7c706057f0773908f0a69ab..6eb43f6ad79c1049dddf270156e73c350f5fba9f 100644 (file)
@@ -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} {