Commit a77fd940 authored by Leigh B Stoller's avatar Leigh B Stoller

Bug fix: watch for slices with no experiment created yet.

parent e5eb478c
......@@ -409,18 +409,25 @@ sub ExpireSlices()
}
else {
if ($slice->isplaceholder()) {
print STDERR "Releasing placeholder $slice $experiment.\n";
print STDERR "Releasing placeholder $slice";
print STDERR " - $experiment"
if (defined($experiment));
print STDERR "\n";
}
else {
print STDERR "Expiring $slice $experiment.\n";
print STDERR "Expiring $slice";
print STDERR " - $experiment"
if (defined($experiment));
print STDERR "\n";
}
}
cleanup:
my $slice_uuid = $slice->uuid();
my $output = emutil::ExecQuiet("$CLEANUPSLICE -f -m $slice_uuid");
my $status = $?;
my $logfile = Logfile->CreateFromString($experiment->gid_idx(),
$output);
if (defined($experiment)) {
my $gid_idx = $experiment->gid_idx();
my $logfile = Logfile->CreateFromString($gid_idx, $output);
if (defined($logfile)) {
$logfile->SetMetadata([["slice_idx", $slice->idx()],
["slice_urn", $slice->urn()],
......@@ -430,6 +437,10 @@ sub ExpireSlices()
], 1);
$logfile->Store();
}
}
else {
print STDERR "$output\n";
}
if ($?) {
print STDERR "Could not release $slice\n";
SENDMAIL($TBOPS, "Could not release slice $slice",
......@@ -443,6 +454,8 @@ sub ExpireSlices()
skip:
$slice->Flush()
if (defined($slice));
$experiment->Flush()
if (defined($experiment));
}
}
......
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