Commit 23bce373 authored by Jonathon Duerig's avatar Jonathon Duerig

Prevent errors in remaining_bandwidth accounting in some cases.

parent 5b665f58
...@@ -2337,6 +2337,7 @@ sub SliverWorkAux($$$$$$$) ...@@ -2337,6 +2337,7 @@ sub SliverWorkAux($$$$$$$)
{ {
my ($credential, $object, $keys, $isupdate, $impotent, $v2, $level) = @_; my ($credential, $object, $keys, $isupdate, $impotent, $v2, $level) = @_;
my $didfwsetup = 0; my $didfwsetup = 0;
my $shouldrollback = 0;
my $restorephys = 0; # Flag to restore physical state my $restorephys = 0; # Flag to restore physical state
my $response; my $response;
my $ticket; my $ticket;
...@@ -2845,6 +2846,7 @@ sub SliverWorkAux($$$$$$$) ...@@ -2845,6 +2846,7 @@ sub SliverWorkAux($$$$$$$)
$experiment->SaveLogFiles(); $experiment->SaveLogFiles();
goto bad; goto bad;
} }
$shouldrollback = 1;
# Dump the output to STDERR for debugging. # Dump the output to STDERR for debugging.
print STDERR $output; print STDERR $output;
...@@ -3553,7 +3555,8 @@ sub SliverWorkAux($$$$$$$) ...@@ -3553,7 +3555,8 @@ sub SliverWorkAux($$$$$$$)
# Restore old physical state. # Restore old physical state.
# #
if ($restorephys) { if ($restorephys) {
if ($experiment->ReserveSharedBandwidth(1, 1) || if (($shouldrollback &&
$experiment->ReserveSharedBandwidth(1, 1)) ||
$experiment->RemovePhysicalState(1) || $experiment->RemovePhysicalState(1) ||
$experiment->RestorePhysicalState()) { $experiment->RestorePhysicalState()) {
print STDERR "Could not restore backup state for $pid,$eid\n"; print STDERR "Could not restore backup state for $pid,$eid\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