Repair fine generator memory leak fine-gen-try-mem-leak
authorBill Erickson <berick@esilibrary.com>
Mon, 27 Aug 2012 14:38:48 +0000 (10:38 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 27 Aug 2012 14:41:23 +0000 (10:41 -0400)
commit3971736a50f3199d05442859331eaa52132c8813
tree339fb8f9e9a3a3eb3daab5c13785a3e95ef839f4
parent4a09e0139f4bf9f1aceb43bc94a67066d1f12147
Repair fine generator memory leak

Calling "next" from with a "try" block results in a memory leak,
presumably because "try" is a sub wrapped in an eval (or vice versa,
whatever, it leaks).  Replacing the "try" with an "eval" avoids the
leak.

This particular leak in the fine generator is onerous when there are
many circulations that are skipped (i.e. next'ed) in the main loop
because they have no fine interval, rate, or max fine.  This is seen
in the osrfsys logs as:

Fine Generator skipping circ 11995439 due to 0 fine interval, 0 fine
rate, or 0 max fine.

And accompanied in the stderr log by:

Exiting eval via next at
/usr/local/share/perl/5.10.1/OpenILS/Application/Storage/Publisher/action.pm
line 820.

Exiting subroutine via next at
/usr/local/share/perl/5.10.1/OpenILS/Application/Storage/Publisher/action.pm
line 820.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm