]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
db retry: Retry on $dbh->state eq ''
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 20 Dec 2016 18:20:35 +0000 (18:20 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 20 Dec 2016 18:23:31 +0000 (18:23 +0000)
This is supposed to represent success.  But now that _need_retry is
only called within a HandleError hook, we know there has been a
failure.

Retry such failures, in the hope that they are stochastic.  If they
aren't, we will fail eventually when we run out of retries.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Osstest/JobDB/Executive.pm

index 5545849bcf47fbaca3f75cafbb5fbb8892baa37b..83e19e48d363566ef0fdcc399894d55d0331da3a 100644 (file)
@@ -62,11 +62,14 @@ sub _need_retry ($) {
     my ($dbh) = @_;
     return
        ($dbh->err() // 0)==7 &&
-       ($dbh->state =~ m/^(?:40P01|40001|23|40002)/);
+       ($dbh->state =~ m/^(?:40P01|40001|23|40002|$)/);
     # DEADLOCK DETECTED or SERIALIZATION FAILURE
     # or any Integrity Constraint Violation including
     # TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION.
     #
+    # Or the empty string, which it seems that we sometimes get on
+    # serialisation errors.
+    #
     # An Integrity Constraint Violation ought not to occur with
     # serialisable transactions, so it is aways a bug.  These bugs
     # should not be retried.  However, there is a longstanding bug in