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:05:41 +0000 (09:05 -0400)
commit7107d94b28dd5f70dc64fb6876dcebe609454170
tree77568d97995c1453de52675c6c28a3d67a7fac7e
parent188e0bf1d5328b7a69eb70b50a2cabd5510f9a7f
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