Commit d9c3dd68 authored by Leigh Stoller's avatar Leigh Stoller

Some fixes to the spewlogfile stuff so that you do not get the

transition error when you click too fast after creating it. Instead of
looking at experiment state, use the logile slot of the experiments
table, and make sure its cleared/set properly in start/swap experiment
scripts.

Also added a spew option to the swap page so you can watch experiments
swap in/out.
parent 98f22c43
......@@ -376,6 +376,7 @@ sub fatal()
# In batch mode, exit.
#
if ($batch) {
TBExptClearLogFile($pid, $eid);
TBUnLockExp($pid, $eid);
exit($errorstat);
}
......
......@@ -237,6 +237,7 @@ if (! $batch) {
else {
die("Bad data in logfile name: $logname");
}
TBExptSetLogFile($pid, $eid, $logname);
if (TBBackGround($logname)) {
#
......@@ -287,9 +288,8 @@ else {
#
# Must unlock before exit.
#
DBQueryWarn("update experiments set expt_locked=NULL ".
"WHERE eid='$eid' and pid='$pid'");
#
TBUnLockExp($pid, $eid);
print "Swap Success\n";
......@@ -317,6 +317,7 @@ SENDMAIL("$user_name <$user_email>",
"Bcc: $TBLOGS",
($repfile, $logname));
TBExptClearLogFile($pid, $eid);
if (defined($logname)) {
unlink("$logname");
}
......@@ -338,6 +339,8 @@ sub fatal($)
# In batch mode, exit without sending the email.
#
if ($batch) {
TBExptClearLogFile($pid, $eid);
TBUnLockExp($pid, $eid);
exit(-1);
}
......@@ -352,6 +355,7 @@ sub fatal($)
"Cc: $TBOPS",
($logname));
TBExptClearLogFile($pid, $eid);
if (defined($logname)) {
unlink("$logname");
}
......
......@@ -45,8 +45,11 @@ if (! TBExptAccessCheck($uid, $pid, $eid, $TB_EXPT_READINFO)) {
# Check for a logfile. This file is transient, so it could be gone by
# the time we get to reading it.
#
$expstate = TBExptState($pid, $eid);
if (strcmp($expstate, $TB_EXPTSTATE_ACTIVATING)) {
$query_result =
DBQueryFatal("select logfile from experiments ".
"where pid='$pid' and eid='$eid' and logfile is not null");
if (mysql_num_rows($query_result) == 0) {
USERERROR("Experiment $pid/$eid is no longer in transition!", 1);
}
......
......@@ -168,7 +168,11 @@ if ($retval == 0) {
swapping. This typically takes $howlong minutes, depending on the
number of nodes in the experiment.
If you do not receive email notification within a reasonable amount
of time, please contact $TBMAILADDR.\n";
of time, please contact $TBMAILADDR.
<br><br>
While you are waiting, you can watch the log of experiment swap
in <a target=_blank href=spewlogfile.php3?pid=$exp_pid&eid=$exp_eid>
realtime</a>.\n";
}
echo "</h3>\n";
......
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