Commit 4081addf authored by Leigh Stoller's avatar Leigh Stoller

Watch for experiments with no nodes, do not return an error to the

caller for maxextension, this is a valid transient state for an
experiment. We always recheck the maxextension in the extension pages
anyway, but throwing an error is annoying.
parent e34bede3
......@@ -1209,10 +1209,21 @@ sub MaxSliceExtension($$$;$) {
my $cur_expire = str2time( $slice->expires() );
my $max_expire = $cur_expire + 60 * 60 * 24 * 180;
my $exptidx = $slice->exptidx();
my $expt = Experiment->Lookup( $exptidx );
my $expt = $slice->GetExperiment();
if (!defined($expt)) {
if( ref( $error ) ) {
$$error = "No experiment for slice, cannot compute max.";
}
return -1;
}
if (! $expt->NodeList(1)) {
if( ref( $error ) ) {
$$error = "No physical nodes, no max to compute.";
}
return -1;
}
my $exptidx = $expt->idx();
my @types = ExptTypes( $exptidx );
foreach my $type ( @types ) {
......
......@@ -685,7 +685,11 @@ sub SliceMaxExtension($)
if (!defined($experiment)) {
return GeniResponse->Create(GENIRESPONSE_BUSY);
}
if (! $experiment->NodeList(1)) {
return GeniResponse->Create(GENIRESPONSE_SUCCESS,
TBDateStringGMT(0x7fff0000));
}
if (Reservation->MaxSliceExtension($slice, \$max, \$reserror)) {
Reservation->FlushAll();
return GeniResponse->Create(GENIRESPONSE_REFUSED, undef, $reserror);
......
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