[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 9/9] db retry: Retry on $dbh->state eq ''



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@xxxxxxxxxxxxx>
---
 Osstest/JobDB/Executive.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 5545849..83e19e4 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -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
-- 
2.1.4


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.