From: Bill Erickson Date: Tue, 18 Jul 2017 14:59:04 +0000 (-0400) Subject: Fine generator recycles cstore drones X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fda4026dcf3f5e071d3ae6a6b9acd785469aaba5;p=working%2FEvergreen.git Fine generator recycles cstore drones Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm index 3d2315488a..ed58009bf1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm @@ -505,9 +505,13 @@ sub generate_fines { eval { - # Clean up after previous transaction. - # This is a no-op if there is no open transaction. - $e->xact_rollback if $commit; + # Clean up after previous transaction and disconnect from + # cstore drone. Forcing a disconnect helps prevent memory + # exhaustion when processing huge batches of transactions. + # Note the disconnect is forced here instead of during + # $e->xact_commit to ensure a disconnect happens with every + # transaction regardless of whether a billing was created. + $e->rollback if $commit; $logger->info(sprintf("Processing $ctype %d...", $c->id));