add sig handler back in for alarm. log error when read times out from alarm
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Jul 2010 18:35:15 +0000 (18:35 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Jul 2010 18:35:15 +0000 (18:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16888 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/support-scripts/marc_stream_importer.pl

index 26b180b..f9546b8 100755 (executable)
@@ -325,11 +325,19 @@ sub process_request {   # The core Net::Server method
     $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 {