From 10cb5c67b409f86831c73cdc9b7c8b1fe3983ff1 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Tue, 23 Oct 2012 23:39:16 -0400 Subject: [PATCH] When scanning for errors, no need to keep scanning once we find an interesting one (deadlock or serialization) because there can be only one such. --- Bucardo.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Bucardo.pm b/Bucardo.pm index 8c5a84e6b..2d4fb881b 100644 --- a/Bucardo.pm +++ b/Bucardo.pm @@ -2160,11 +2160,13 @@ sub start_kid { if ($state eq '40P01' and $x->{dbtype} eq 'postgres') { $msg .= $self->get_deadlock_details($dbh, $msg); $moresub = ' (deadlock)'; + last; } elsif ($state eq '40001' and $config{kid_serial_sleep}) { $gotosleep = $config{kid_serial_sleep}; $moresub = ' (serialization)'; $self->glog("Could not serialize, sleeping for $gotosleep seconds", LOG_TERSE); + last; } } } -- 2.39.5