From 02edc5ca4b6cc1b4f7c03d2faaa18b09ac4764bf Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 30 Dec 2016 11:54:08 -0500 Subject: [PATCH] LP#1653001 Hold details authoritative API cstore maintenance Avoid cstore exhaustion during .authorative API calls that run Holds:retrieve_hold_queue_status_impl() by using the in-transaction editor for YAOUS lookups instead of allowing the lookups to create their own cstore connections, each spawning a new transaction, since CStoreEditor is in authoritative mode. Since CStoreEditor authoritative handling leaves each cstore transaction open until the API call completes, and in this case, each hold in the batch lookup resulted in 2 additional open cstore connections per hold, a batch lookup of (say) 15 holds, meant 31 cstore connections were opened in one API call. Telling the YAOUS lookup to use the existing editor means the same call completes with 1 cstore connection. Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 9f5f42c7d1..1825c71580 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1443,8 +1443,10 @@ sub retrieve_hold_queue_status_impl { my $user_org = $e->json_query({select => {au => ['home_ou']}, from => 'au', where => {id => $hold->usr}})->[0]->{home_ou}; - my $default_wait = $U->ou_ancestor_setting_value($user_org, OILS_SETTING_HOLD_ESIMATE_WAIT_INTERVAL); - my $min_wait = $U->ou_ancestor_setting_value($user_org, 'circ.holds.min_estimated_wait_interval'); + my $default_wait = $U->ou_ancestor_setting_value( + $user_org, OILS_SETTING_HOLD_ESIMATE_WAIT_INTERVAL, $e); + my $min_wait = $U->ou_ancestor_setting_value( + $user_org, 'circ.holds.min_estimated_wait_interval', $e); $min_wait = OpenSRF::Utils::interval_to_seconds($min_wait || '0 seconds'); $default_wait ||= '0 seconds'; -- 2.43.2