Commit 87183080 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Fix (I hope) for batch daemon race condition that was causing dequeue

not to work.
parent 0009835f
......@@ -79,7 +79,7 @@ use vars qw(@ISA @EXPORT);
EXPTSTATE_MODIFY_PARSE EXPTSTATE_MODIFY_REPARSE EXPTSTATE_MODIFY_RESWAP
EXPTSTATE_RESTARTING
BATCHSTATE_LOCKED BATCHSTATE_UNLOCKED
EXPTCANCEL_CLEAR EXPTCANCEL_TERM EXPTCANCEL_SWAP
EXPTCANCEL_CLEAR EXPTCANCEL_TERM EXPTCANCEL_SWAP EXPTCANCEL_DEQUEUE
TBSetCancelFlag TBGetCancelFlag
......@@ -497,6 +497,7 @@ sub BATCHSTATE_UNLOCKED() { "unlocked";}
sub EXPTCANCEL_CLEAR() { 0 ;}
sub EXPTCANCEL_TERM() { 1 ;}
sub EXPTCANCEL_SWAP() { 2 ;}
sub EXPTCANCEL_DEQUEUE() { 3 ;}
sub USERSTATUS_ACTIVE() { "active"; }
sub USERSTATUS_FROZEN() { "frozen"; }
......
......@@ -512,7 +512,8 @@ sub startexp($)
if ($canceled == EXPTCANCEL_TERM) {
cancelexp($exphash);
}
elsif ($canceled == EXPTCANCEL_SWAP) {
elsif ($canceled == EXPTCANCEL_SWAP ||
$canceled == EXPTCANCEL_DEQUEUE) {
swapexp($exphash);
}
else {
......
......@@ -522,11 +522,10 @@ else {
#
# XXX. The batch daemon might already have the experiment, but
# not have shipped it off to startexp. Change the state
# anyway. The error will be noticed later when startexp dies,
# and the batch daemon gets the error back. This sucks.
#
$experiment->SetState(EXPTSTATE_SWAPPED);
# not have shipped it off to startexp. Use a cancel flag since
# that is the only consistent mechanism to tell the batch daemon
# what it should do.
$experiment->SetCancelFlag(EXPTCANCEL_DEQUEUE);
}
elsif ($inout eq "modify") {
ExitWithStatus(1,
......
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