[open-ils-commits] r16888 - trunk/Open-ILS/src/support-scripts (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jul 8 14:35:19 EDT 2010


Author: erickson
Date: 2010-07-08 14:35:15 -0400 (Thu, 08 Jul 2010)
New Revision: 16888

Modified:
   trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
Log:
add sig handler back in for alarm.  log error when read times out from alarm

Modified: trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl	2010-07-08 18:29:05 UTC (rev 16887)
+++ trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl	2010-07-08 18:35:15 UTC (rev 16888)
@@ -325,11 +325,19 @@
     $logger->info("stream parser received contact");
     my $data;
     eval {
+        local $SIG{ALRM} = sub { die "alarm\n" };
         alarm $wait_time; # prevent accidental tie ups of backend processes
         $data = <STDIN>;
         alarm 0;
     };
+
+    if($@) {
+        $logger->error("reading from STDIN failed or timed out: $@");
+        return;
+    } 
+
     $logger->info("stream parser read " . length($data) . " bytes");
+
     if ($real_opts->{noqueue}) {
         old_process_batch_data($data);
     } else {



More information about the open-ils-commits mailing list