This can happen if the locks are removed, which we are about to do.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
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
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} {