Commit 40bc8389 authored by Chad Barb's avatar Chad Barb

(hopefully) fixed bug in startexp
affecting batch system by switching two cleanup checks.
(I wasn't giving it an opportunity to bail on a batchexp failing
 soon enough.)

Also, tidied up return code for tbswap.
parent 6f0d0d77
......@@ -379,13 +379,6 @@ sub fatal()
GatherSwapStats($pid, $eid, $dbuid, TBDB_STATS_START, $errorstat);
}
#
# If we got far enough to allocate nodes, must run tbend.
#
if ($estate ne EXPTSTATE_NEW) {
tbendit();
}
#
# In batch mode, exit. Must unlock the experiment since the record
# is kept by the batch system until it is finished or canceled.
......@@ -396,6 +389,13 @@ sub fatal()
exit($errorstat);
}
#
# If we got far enough to allocate nodes, must run tbend.
#
if ($estate ne EXPTSTATE_NEW) {
tbendit();
}
#
# Okay, we *are* going to terminate the experiment.
#
......
......@@ -8,6 +8,10 @@
use English;
# Returns 0 on success.
# Returns 1 on non-assign_wrapper failure.
# Returns (1 | assign_wrapper's errorcode) on assign_wrapper failure.
# XXX: handle error cases for update? (backup the db?)
# XXX: Shouldn't do idempotent stuff twice for update.
# XXX: repush/calc routing for update??? (tbprerun)
......@@ -368,10 +372,7 @@ if (! $errors) {
if (defined $nextState) {
if (! SetExpState($pid, $eid, $nextState)) {
print STDERR "*** Failed to set experiment state.\n";
#
# Don't obliterate a meaningful error code if this happens.
#
if (! $errors) { $errors = 1; }
$errors = 1;
}
}
......@@ -383,15 +384,16 @@ if ($errors) {
print "Failingly finished swap-$swapop for $pid/$eid. " . TBTimeStamp() . "\n";
TBDebugTimeStamp("tbswap $swapop finished (failed)");
# pass this info along.
$errors |= $assignWrapperErrorCode;
# pass assign wrapper info along.
# other codes in 'errors' (3 or 7) are meaningless and
# should just be reported as 1's.
exit( 1 | $assignWrapperErrorCode );
} else {
print "Successfully finished swap-$swapop for $pid/$eid. " . TBTimeStamp() . "\n";
TBDebugTimeStamp("tbswap $swapop finished (succeeded)");
exit( 0 );
}
exit($errors);
#################################
##
......
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