Serials: MFHD::get_compressed_holdings() can reach infinite loop
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 6 May 2013 18:15:18 +0000 (14:15 -0400)
committerDan Wells <dbw2@calvin.edu>
Tue, 14 May 2013 13:03:45 +0000 (09:03 -0400)
commit11324fd3722dc7e55700bacf538dd2026feb7820
treef22cdb1c8665676e3b2d623bf795c74b74dd5652
parenta8e31242be0f54620c269d5f2e50c62010c3bd37
Serials: MFHD::get_compressed_holdings() can reach infinite loop

Even controlled serials holdings involve the internal creation of MFHD
fields, upon which caculations are performed for such purposes as the
display of holdings summaries in the OPAC.

There are too many ways that incorrect MFHD (or MFHD that our code just
can't yet handle) can lead our MFHD routines to crash. We can't address
all these possibilities in a single bug fix. But we can avoid this
infinite loop.

A subroutine within open-ils.serial (_summarize_contents()) relies on
MFHD::get_compressed_holdings(). When the latter went into an infinite
loop the result would be an open-il.serial drone process consuming CPU
time indefinitely and, depending on the data that provoked the loop,
potentially writing repeating messages to stderr indefinitely.

End users will still see the item receiving fail in these cases, and be
obliged to work around the issue as before until more robust
holdings summarization code can be written, but at least the overall
condition of the running Evergreen system won't be affected, and there
will be better information in the error logs.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
Open-ILS/src/perlmods/lib/OpenILS/Utils/MFHD.pm