From: Ian Jackson Date: Tue, 20 Dec 2016 18:20:35 +0000 (+0000) Subject: db retry: Retry on $dbh->state eq '' X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f9234b1e797f5c3dd8678a29bad1eb11f0507aa4;p=people%2Fiwj%2Fosstest.git 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 --- diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm index 5545849b..83e19e48 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