From a74018b56533af729c9cf2e99178a4f70ef02137 Mon Sep 17 00:00:00 2001 From: Russ Fish Date: Fri, 3 Aug 2007 22:58:44 +0000 Subject: [PATCH] Report the current state when complaining that an experiment isn't active. --- tbsetup/eventsys_control.in | 2 +- tbsetup/node_update.in | 2 +- www/linktest.php3 | 10 ++++++---- www/replayexp.php3 | 16 ++++++++++++++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/tbsetup/eventsys_control.in b/tbsetup/eventsys_control.in index a5cd8311b..5176abd24 100755 --- a/tbsetup/eventsys_control.in +++ b/tbsetup/eventsys_control.in @@ -150,7 +150,7 @@ if ($expstate ne EXPTSTATE_ACTIVE && $expstate ne EXPTSTATE_ACTIVATING && $expstate ne EXPTSTATE_MODIFY_RESWAP && $expstate ne EXPTSTATE_SWAPPING) { - tbdie("$experiment must be active (or swapping)!"); + tbdie("$experiment must be active (or swapping), not $expstate!"); } # diff --git a/tbsetup/node_update.in b/tbsetup/node_update.in index ae5075b2b..6fa40e0cf 100644 --- a/tbsetup/node_update.in +++ b/tbsetup/node_update.in @@ -117,7 +117,7 @@ if (! defined($experiment)) { # Check state. Only ACTIVE experiments. # if ($experiment->state() ne EXPTSTATE_ACTIVE) { - print STDERR "Experiment $pid/$eid is not ACTIVE!\n"; + print STDERR "Experiment $pid/$eid is in state $estate, not ACTIVE!\n"; # For web page. exit(1); } diff --git a/www/linktest.php3 b/www/linktest.php3 index 33d9d849e..bd5900e8c 100644 --- a/www/linktest.php3 +++ b/www/linktest.php3 @@ -61,10 +61,12 @@ function CHECKPAGEARGS() { USERERROR("You do not have permission to start/stop linktest ". "on $pid/$eid!", 1); } - if ($experiment->state() != $TB_EXPTSTATE_ACTIVE && - $experiment->state() != $TB_EXPTSTATE_ACTIVATING && - $experiment->state() != $TB_EXPTSTATE_MODIFY_RESWAP) { - USERERROR("Experiment $eid must be active to start/stop linktest!", 1); + $expstate = $experiment->state(); + if ($expstate != $TB_EXPTSTATE_ACTIVE && + $expstate != $TB_EXPTSTATE_ACTIVATING && + $expstate != $TB_EXPTSTATE_MODIFY_RESWAP) { + USERERROR("Experiment $eid must be active to start/stop linktest," . + " not $expstate!", 1); } $pid = $experiment->pid(); $eid = $experiment->eid(); diff --git a/www/replayexp.php3 b/www/replayexp.php3 index 58930491a..5f4864793 100644 --- a/www/replayexp.php3 +++ b/www/replayexp.php3 @@ -80,8 +80,20 @@ set_time_limit(0); STARTBUSY("Starting event replay"); $retval = SUEXEC($uid, "$pid,$unix_gid", "webeventsys_control replay $pid,$eid", - SUEXEC_ACTION_DIE); -STOPBUSY(); + SUEXEC_ACTION_IGNORE); +CLEARBUSY(); + +# +# Fatal Error. Report to the user, even though there is not much he can +# do with the error. Also reports to tbops. +# +if ($retval < 0) { + SUEXECERROR(SUEXEC_ACTION_DIE); + # + # Never returns ... + # + die(""); +} echo "Events for your experiment are now being replayed.\n"; -- GitLab