Commit 32560429 authored by Mike Hibler's avatar Mike Hibler
Browse files

Minor fixes: add another level of panic that we set when swapout fails.

Produces a different message in the web page.

Also fix up a couple of minor firewalled elabinelab issues.
parent 682c31e8
......@@ -4145,11 +4145,14 @@ sub TBNodeFirewall ($$$) {
#
# Set the paniced bit for an experiment.
#
sub TBExptSetPanicBit($$) {
my ($pid, $eid) = @_;
sub TBExptSetPanicBit($$;$) {
my ($pid, $eid, $value) = @_;
$value = 1
if (!defined($value));
return DBQueryWarn("update experiments set ".
" paniced=1,panic_date=now() ".
" paniced=$value,panic_date=now() ".
"where pid='$pid' and eid='$eid'");
}
......
......@@ -907,16 +907,7 @@ sub TearDownEmulab()
my $tbdir = "/usr/testbed";
my $wap = "$tbdir/sbin/withadminprivs";
my $nodereboot = "$tbdir/bin/node_reboot";
my $paniced;
#
# If firewalled, check to see if paniced. Right now that means the nodes
# are going to be powered off, so need to do the clean shutdown dance.
#
if ($firewalled) {
TBExptGetPanicBit($pid, $eid, \$paniced);
}
#
# We want to rebuild the DHCPD file so that when we reboot the inner nodes
# they come back to the outer emulab. We cannot just free the nodes, cause
......@@ -959,10 +950,11 @@ sub TearDownEmulab()
"where pid='$pid' and eid='$eid'");
#
# If panic set, just return; nodes are going to be powered down.
# If firewalled, just return now since all nodes will be powered
# off anyway.
#
if ($firewalled and $paniced) {
print "Skipping clean shutdown cause panic button pressed.\n";
if ($firewalled) {
print "Skipping clean shutdown since experiment is firewalled.\n";
return 0;
}
......@@ -1054,7 +1046,7 @@ sub RemoveNodes()
my $nodereboot = "$tbdir/bin/node_reboot";
my $deletenode = "$tbdir/sbin/deletenode";
my @nodes = ();
my $paniced;
my $paniced = 0;
#
# If firewalled, check to see if paniced. Right now that means the nodes
......@@ -1068,8 +1060,8 @@ sub RemoveNodes()
# Actually, this should not even happen; a paniced experiment cannot be
# modified at all.
#
if ($firewalled and $paniced) {
print "An paniced experiment cannot be modified! What happened?\n";
if ($paniced) {
print "A paniced experiment cannot be modified! What happened?\n";
return -1;
}
......@@ -1260,7 +1252,7 @@ sub UpdateEmulab()
my $nodereboot = "$tbdir/bin/node_reboot";
my $nodewait = "$tbdir/sbin/node_statewait";
my @nodes = ();
my $paniced;
my $paniced = 0;
#
# If firewalled, check to see if paniced. Right now that means the nodes
......@@ -1274,8 +1266,8 @@ sub UpdateEmulab()
# Actually, this should not even happen; a paniced experiment cannot be
# modified at all.
#
if ($firewalled and $paniced) {
print "An paniced experiment cannot be modified! What happened?\n";
if ($paniced) {
print "A paniced experiment cannot be modified! What happened?\n";
return -1;
}
......
......@@ -1538,7 +1538,7 @@ done:
} else {
push(@fwstate, "Firewall cnet interface disabled");
}
TBExptSetPanicBit($pid, $eid);
TBExptSetPanicBit($pid, $eid, 2);
$op = "Swapout";
} else {
$op = "Modify";
......
......@@ -312,7 +312,22 @@ if (TBExptFirewall($exp_pid, $exp_eid) &&
$expstate == $TB_EXPTSTATE_ACTIVATING ||
$expstate == $TB_EXPTSTATE_SWAPPING)) {
echo "<center>\n";
if ($paniced) {
if ($paniced == 2) {
#
# Paniced due to failed swapout.
# Only be semi-obnoxious (no blinking) since it wasn't their fault.
#
echo "<br><font size=+1 color=red>".
"Your experiment was cut off due to a failed swapout on $panic_date!".
"<br>".
"You will need to contact testbed operations to make further ".
"changes (swap, terminate) to your experiment.</font>";
}
elseif ($paniced) {
#
# Paniced due to panic button.
# Full-on obnoxious is called for here!
#
echo "<br><font size=+1 color=red><blink>".
"Your experiment was cut off via the Panic Button on $panic_date!".
"<br>".
......
Supports Markdown
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