From: Lebbeous Fogle-Weekley Date: Wed, 13 Feb 2013 15:34:17 +0000 (-0500) Subject: Serials: change more carp() to croak() to avoid infinite loops X-Git-Tag: sprint4-merge-nov22~3424 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=12751e0cb7556a9dd23abdfddf1ad70bb3184c70;p=working%2FEvergreen.git Serials: change more carp() to croak() to avoid infinite loops This addresses a problem very similar to that in LP #1075167, where certain loops never end because problems with the data elicited calls to carp(), which fills up log, but never gives our loops notice to end. Visible symptoms include 1) a greate volume of log spew and 2) an open-ils.serial drone that ties up a CPU. The fault lies maybe in our loops rather than in the MFHD package, but this fixes the problem fastest, and should not have undesirable side-effects. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm index bec26771b3..a873372f17 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD/Caption.pm @@ -335,7 +335,7 @@ sub calendar_increment { # A calendar change is defined, need to check if it applies if (scalar(@{$new}) == 1) { - carp "Can't calculate date change for ", $self->as_string; + croak "Can't calculate date change for ", $self->as_string; return 0; } @@ -473,7 +473,7 @@ sub next_chron { # There was no suitable publication pattern defined, # so use the $w frequency to figure out the next date if (!defined($freq)) { - carp "Undefined frequency in next_chron!"; + croak "Undefined frequency in next_chron!"; } elsif (!MFHD::Date::can_increment($freq)) { croak "Don't know how to deal with frequency '$freq'!"; } else {