From 06ad5407984b528cedf9eeddbec50072981a6921 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 19 Jan 2012 17:01:22 -0500 Subject: [PATCH] Handle search timeouts more gracefully Another tweak courtesy of berick Returns 0 results if open-ils.storage timeouts instead of a nasty uncaught undefined ARRAY exception resulting in an OPAC "spinning wheel of death" (formerly the "green knight rider bar of death". Note that in the event of storage timeouts, you should tune and/or beef-up your database. Signed-off-by: Jason Etheridge Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index 005eb017a9..80b418f525 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -1166,7 +1166,6 @@ sub staged_search { my $start = time; $results = $U->storagereq($method, %$search_hash); $search_duration = time - $start; - $logger->info("staged search: DB call took $search_duration seconds and returned ".scalar(@$results)." rows, including summary"); $summary = shift(@$results) if $results; unless($summary) { @@ -1175,6 +1174,8 @@ sub staged_search { return {count => 0}; } + $logger->info("staged search: DB call took $search_duration seconds and returned ".scalar(@$results)." rows, including summary"); + my $hc = $summary->{estimated_hit_count} || $summary->{visible}; if($hc == 0) { $logger->info("search returned 0 results: duration=$search_duration: params=". -- 2.11.0