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

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

parent e5eb478c
...@@ -409,26 +409,37 @@ sub ExpireSlices() ...@@ -409,26 +409,37 @@ sub ExpireSlices()
} }
else { else {
if ($slice->isplaceholder()) { 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 { else {
print STDERR "Expiring $slice $experiment.\n"; print STDERR "Expiring $slice";
print STDERR " - $experiment"
if (defined($experiment));
print STDERR "\n";
} }
} }
cleanup: cleanup:
my $slice_uuid = $slice->uuid(); my $slice_uuid = $slice->uuid();
my $output = emutil::ExecQuiet("$CLEANUPSLICE -f -m $slice_uuid"); my $output = emutil::ExecQuiet("$CLEANUPSLICE -f -m $slice_uuid");
my $status = $?; my $status = $?;
my $logfile = Logfile->CreateFromString($experiment->gid_idx(), if (defined($experiment)) {
$output); my $gid_idx = $experiment->gid_idx();
if (defined($logfile)) { my $logfile = Logfile->CreateFromString($gid_idx, $output);
$logfile->SetMetadata([["slice_idx", $slice->idx()], if (defined($logfile)) {
["slice_urn", $slice->urn()], $logfile->SetMetadata([["slice_idx", $slice->idx()],
["slice_uuid", $slice->uuid()], ["slice_urn", $slice->urn()],
# For web interface listing ["slice_uuid", $slice->uuid()],
["Method", "Cleanup"], # For web interface listing
], 1); ["Method", "Cleanup"],
$logfile->Store(); ], 1);
$logfile->Store();
}
}
else {
print STDERR "$output\n";
} }
if ($?) { if ($?) {
print STDERR "Could not release $slice\n"; print STDERR "Could not release $slice\n";
...@@ -443,6 +454,8 @@ sub ExpireSlices() ...@@ -443,6 +454,8 @@ sub ExpireSlices()
skip: skip:
$slice->Flush() $slice->Flush()
if (defined($slice)); 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