Commit 844db6f3 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Turn off idle checking; make it an option that is off by default.

Slices will now get terminated when the expiration time is reached.
parent a364642f
......@@ -17,12 +17,13 @@ use Getopt::Std;
#
sub usage()
{
print "Usage: expire_daemon [-d]\n";
print "Usage: expire_daemon [-d] [-i]\n";
exit(1);
}
my $optlist = "d";
my $debug = 0;
my $asch = 0;
my $optlist = "di";
my $debug = 0;
my $idlecheck = 0;
my $asch = 0;
#
# Configure variables
......@@ -70,6 +71,9 @@ if (! getopts($optlist, \%options)) {
if (defined($options{"d"})) {
$debug = 1;
}
if (defined($options{"i"})) {
$idlecheck = 1;
}
# Do this early so that we talk to the right DB.
use vars qw($GENI_DBNAME);
......@@ -178,29 +182,31 @@ sub ExpireSlices()
$slice->UnLock();
goto skip;
}
my $pid = $experiment->pid();
my $eid = $experiment->eid();
my @localnodes = ();
#
# See if we have any local nodes. No point in using the idle
# check if there are no nodes.
#
$experiment->LocalNodeListNames(\@localnodes);
if (@localnodes) {
#
# Use the idletimes program in summary mode to see if the
# the nodes are idle. If they are then it gets swapped.
# This is going to have to get more sophisticated.
#
print STDERR "Checking to see if $slice is idle\n";
system("$IDLETIMES -s $pid,$eid");
if (! $?) {
$slice->UnLock();
goto skip;
if ($idlecheck) {
my @localnodes = ();
$experiment->LocalNodeListNames(\@localnodes);
if (@localnodes) {
my $pid = $experiment->pid();
my $eid = $experiment->eid();
#
# Use the idletimes program in summary mode to see if the
# the nodes are idle. If they are then it gets swapped.
# This is going to have to get more sophisticated.
#
print STDERR "Checking to see if $slice ($eid) is idle\n";
system("$IDLETIMES -s $pid,$eid");
if (! $?) {
$slice->UnLock();
goto skip;
}
}
print STDERR "$slice is idle; releasing.\n";
}
print STDERR "$slice is idle; releasing.\n";
cleanup:
if (GeniCM::CleanupDeadSlice($slice) != 0) {
print STDERR "Could not release $slice\n";
......
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