From ddb3c834e48a995e412bbe5834a8b1c03f13e7f5 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 8 Jul 2010 18:35:15 +0000 Subject: [PATCH] add sig handler back in for alarm. log error when read times out from alarm 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.pl b/Open-ILS/src/support-scripts/marc_stream_importer.pl index 26b180b37..f9546b8b7 100755 --- a/Open-ILS/src/support-scripts/marc_stream_importer.pl +++ b/Open-ILS/src/support-scripts/marc_stream_importer.pl @@ -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 = ; 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 { -- 2.11.0