LP#1704396: reset the facet alarm timer
authorMike Rylander <mrylander@gmail.com>
Wed, 1 Nov 2017 22:22:21 +0000 (18:22 -0400)
committerJason Stephenson <jason@sigio.com>
Wed, 8 Nov 2017 18:46:04 +0000 (13:46 -0500)
When using alarm() one must reset the timer via alarm(0) or incur the wrath
of the spurious signal.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Jason Stephenson <jason@sigio.com>

Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm

index 4a0336d..06ec97d 100644 (file)
@@ -1364,11 +1364,13 @@ sub retrieve_cached_facets {
 
     eval {
         local $SIG{ALRM} = sub {die};
-        alarm(4); # we'll sleep for as much as 4s
+        alarm(10); # we'll sleep for as much as 10s
         do {
             die if $cache->get_cache($key . '_COMPLETE');
         } while (sleep(0.05));
+        alarm(0);
     };
+    alarm(0);
 
     my $blob = $cache->get_cache($key) || {};