@@ -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
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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)