Commit 4b83580a authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Wrap schema load with an alarm to avoid 60 second hang up until

connection times out. Lets use 5 seconds for now.
parent c05b40bb
#!/usr/bin/perl -w
#
# Copyright (c) 2011 University of Utah and the Flux Group.
# Copyright (c) 2011-2017 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -27,7 +27,7 @@
#
# }}}
#
#use English;
use English;
use Getopt::Std;
use XML::LibXML;
use XML::LibXML::XPathContext;
......@@ -82,7 +82,10 @@ sub addSchema($$)
if (! exists($ns2file{$ns})) {
my $schema;
eval {
local $SIG{ALRM} = sub { die("Timed out\n"); };
alarm 5;
$schema = XML::LibXML::Schema->new(location => $file);
alarm 0;
};
if ($@) {
die("Failed to load schema for namespace $ns from location $file\n: $@");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment