Commit 3f187bd1 authored by Leigh Stoller's avatar Leigh Stoller

Bug Fix: Make sure expt_expires is cleared at swapout.

parent 15602ab9
#!/usr/bin/perl -wT
#
# Copyright (c) 2005-2017 University of Utah and the Flux Group.
# Copyright (c) 2005-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -1353,14 +1353,18 @@ sub SetBatchMode($$) {
}
#
# We use this for admission control of geni slices.
# We use this for admission control of geni slices and classic
# experiments that have an autoswap set.
#
sub SetExpiration($$)
{
my ($self, $expires) = @_;
my $idx = $self->idx();
if ($expires =~ /^\d+$/) {
if (!defined($expires)) {
$expires = "NULL";
}
elsif ($expires =~ /^\d+$/) {
$expires = "FROM_UNIXTIME($expires)";
}
else {
......@@ -2573,6 +2577,10 @@ sub PostSwap($$$$)
"where idx=$rsrcidx");
}
}
# Lets clear this since a swaped experiment has no expiration.
if ($which eq $EXPT_SWAPOUT) {
$self->SetExpiration(undef);
}
#
# This last step clears lastrsrc, which is how we know that the record
......
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