Commit d5501725 authored by Mac Newbold's avatar Mac Newbold

Update idleswap_timeout when swapping any way but out (in, restart,

modify, etc). Notify the user on the web page just before they hit confirm
if we'll be updating it, as an FYI. (Only tell them if it matters, ie if
the idleswap bit is set.)
parent 5c67bf1f
......@@ -177,6 +177,10 @@ if ($UID && !TBAdmin($UID) &&
" You do not have permission to swap or modify this experiment!\n");
}
# Must do this before lock tables!
# idleswap is in minutes, threshold is in hours
$idleswap_time = 60 * TBGetSiteVar("idle/threshold");
#
# We have to protect against trying to end an experiment that is currently
# in the process of being terminated. We use a "wrapper" state (actually
......@@ -300,10 +304,12 @@ if ($inout eq "restart" && $estate ne EXPTSTATE_ACTIVE) {
# if $inout eq "modify", either EXPTSTATE_ACTIVE -or- EXPTSTATE_SWAPPED is ok.
#
# Set the timestamp now, and unlock the experiments table.
#
DBQueryFatal("UPDATE experiments SET expt_locked=now() ".
# Also update idleswap_timeout to whatever the current value is
if ($inout ne "out") {
$idlestr = ", idleswap_timeout='$idleswap_time'";
} else { $idlestr = ""; }
DBQueryFatal("UPDATE experiments SET expt_locked=now() $idlestr ".
"WHERE eid='$eid' and pid='$pid'");
DBQueryFatal("unlock tables");
......@@ -540,7 +546,7 @@ if (defined($logname)) {
my $message =
"Experiment $eid in project $pid has been ";
if ($idleswap || $autoswap || $force) {
if ($inout eq "out" && ($idleswap || $autoswap || $force) ) {
$message .= "forcibly swapped out by\nTestbed Operations";
if ($idleswap) {
$message .= " because it was idle for too long (Idle-Swap).\n".
......
......@@ -83,6 +83,9 @@ $row = mysql_fetch_array($query_result);
$exp_gid = $row[gid];
$batch = $row[batchmode];
$swappable=$row[swappable];
$idleswap_bit=$row[idleswap];
$idlethresh=TBGetSiteVar("idle/threshold");
#
# Look for transition in progress and exit with error.
......@@ -158,6 +161,11 @@ if (!$confirmed) {
echo "<b><input type=submit name=canceled value=Cancel></b>\n";
echo "</form>\n";
if ($inout!="out" && $idleswap_bit) {
echo "<p>Note: The Idle-Swap time for your experiment will be
updated to $idlethresh hours.</p>\n";
}
if (!strcmp($inout, "restart")) {
echo "<p>
<a href='$TBDOCBASE/faq.php3#UTT-Restart'>
......
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