Commit 612f2200 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Fix the CPU exceeded handling code; it was looking at the wrong part

of the exit code to see if the parser had been KILLed by the system.

Since the parser now runs on ops, increase the limit from from 60 to
180 seconds, but also increase the nice level.
parent 8711c84b
......@@ -152,26 +152,26 @@ if (!defined($pid)) {
#
if (! $pid) {
# Set the CPU limit for us.
setrlimit(RLIMIT_CPU, 60, 60);
setrlimit(RLIMIT_CPU, 180, 180);
# Give parent a chance to react.
sleep(1);
system("nice $parser @ARGV $nsfile");
exit($? >> 8);
exec("nice -15 $parser @ARGV $nsfile");
die("Could not exec the parser!\n");
}
#
# Parent waits.
#
waitpid($pid, 0);
my $exit_status = $? >> 8;
my $exit_status = $?;
#
# If the child was KILLed, then it overran its time limit.
# Send email. Otherwise, exit with result of child.
#
if ($exit_status == SIGKILL) {
if (($exit_status & 0xff) == SIGKILL) {
my $msg = "Parser Exceeded CPU Limit";
SENDMAIL($TBOPS, "Parser Exceeded CPU Limit", $msg,
......@@ -186,5 +186,5 @@ if ($exit_status == SIGKILL) {
if (-d $tempdir) {
system("/bin/rm -r $tempdir");
}
exit($exit_status);
exit($exit_status >> 8);
......@@ -231,6 +231,7 @@ Simulator instproc run {} {
var_import ::GLOBALS::irfile
var_import ::GLOBALS::ran
var_import ::GLOBALS::impotent
var_import ::GLOBALS::passmode
var_import ::GLOBALS::vtypes
var_import ::GLOBALS::uselatestwadata
var_import ::GLOBALS::usewatunnels
......@@ -274,7 +275,7 @@ Simulator instproc run {} {
if {$errors == 1} {return}
# If we are running in impotent mode we stop here
if {$impotent == 1} {return}
if {$impotent == 1 && $passmode == 0} {return}
$self spitxml_init
......
Markdown is supported
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