All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 384708fd authored by Leigh B Stoller's avatar Leigh B Stoller

Possible fix for slice cancelation race condition.

parent 254aed8d
......@@ -2777,7 +2777,7 @@ sub WaitForNodes($$$$@)
#
my $waittime = 0;
my $minutes = 0;
my $canceled = $experiment->canceled();
my $canceled = $experiment->Canceled();
#
# Wait for the nodes to finish booting, as recorded in database.
......@@ -2786,7 +2786,7 @@ sub WaitForNodes($$$$@)
#
# Check for cancelation. We quit the monitor.
#
$canceled = $experiment->canceled();
$canceled = $experiment->Canceled();
if ($canceled) {
print STDERR "WaitForNodes canceled; terminating early!\n";
#
......@@ -3030,7 +3030,7 @@ sub WaitForNodes($$$$@)
$slice->LockTables();
# Do this first. See cancel in DeleteSlice().
$slice->ClearMonitorPid();
if ($experiment->canceled()) {
if ($experiment->Canceled()) {
$experiment->SetCancelFlag(0);
}
$slice->UnLockTables();
......
......@@ -8159,7 +8159,7 @@ sub KillMonitor($)
print STDERR "Monitor in progress: process id $pid ...\n";
if ($experiment->canceled()) {
if ($experiment->Canceled()) {
print STDERR "Cancel flag already set for $experiment\n";
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Unable to stop monitor");
......
......@@ -916,7 +916,7 @@ sub DeleteSlice($)
# is not affected.
#
GeniCM::CheckMonitor($slice);
if ($slice->monitor_pid()) {
if ($slice->GetMonitorPid()) {
if (!$cancel) {
$slice->UnLock();
return GeniResponse->MonitorResponse()
......@@ -956,11 +956,12 @@ sub DeleteSlice($)
# If we were canceled, we wait for the monitor to stop, instead of
#
if ($canceled) {
while ($slice->monitor_pid()) {
while ($slice->GetMonitorPid()) {
sleep(10);
GeniCM::CheckMonitor($slice);
print STDERR "Checking to see if monitor has stopped ...\n";
}
}
my $retval = GeniCM::CleanupDeadSlice($slice, 1);
if ($retval) {
......
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