From 1c6267f2f17a6103b56e55651814601c3571c842 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 27 Apr 2015 10:10:32 -0700 Subject: [PATCH] scheduler: fix possible bug if use assigned jobs with FCGI scheduler Need to end the enumeration. --- html/ops/grant_credit.php | 3 +++ sched/sched_assign.cpp | 5 ++++- sched/sched_score.h | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/html/ops/grant_credit.php b/html/ops/grant_credit.php index 5f532e3df3..79116017cf 100644 --- a/html/ops/grant_credit.php +++ b/html/ops/grant_credit.php @@ -16,6 +16,9 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . +// DEPRECATED - WON'T WORK. +// result.claimed_credit is not used any more + // Award credit to users/hosts/teams for WU which have been // cancelled or have otherwise failed (error_mask != 0). // Credit granted is credit claimed, with a hardwired limit of 300 units. diff --git a/sched/sched_assign.cpp b/sched/sched_assign.cpp index 89332015d2..8b1865ebe9 100644 --- a/sched/sched_assign.cpp +++ b/sched/sched_assign.cpp @@ -256,7 +256,10 @@ bool send_jobs(int assign_type) { } while (!asg.enumerate(query)) { - if (!work_needed(false)) continue; + if (!work_needed(false)) { + asg.end_enumerate(); + break; + } // if the WU doesn't exist, delete the assignment record. // diff --git a/sched/sched_score.h b/sched/sched_score.h index 64528901ce..76c82ee1b0 100644 --- a/sched/sched_score.h +++ b/sched/sched_score.h @@ -1,6 +1,6 @@ // This file is part of BOINC. // http://boinc.berkeley.edu -// Copyright (C) 2008 University of California +// Copyright (C) 2015 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License @@ -15,10 +15,10 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// job dispatch using a score-based approach. See sched_scure.cpp +// job dispatch using a score-based approach. See sched_score.cpp struct JOB { - int index; + int index; // index into shared-mem job array int result_id; double score; APP* app;