From 3488b286cf05ee25d223a0f9462f44e4a5b6b5a6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 21 May 2013 22:01:30 -0700 Subject: [PATCH] client: don't piggyback work request in several situations namely: - some download stalled - some task suspended - too many uploading tasks --- client/work_fetch.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 680c0f49f9..96659a02c7 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -459,15 +459,14 @@ bool WORK_FETCH::requested_work() { return false; } -// we're going to contact this project for reasons other than work fetch; -// decide if we should "piggyback" a work fetch request. +// We're going to contact this project for reasons other than work fetch +// (e.g., to report completed results, or at user request). +// Decide if we should "piggyback" a work fetch request. // void WORK_FETCH::piggyback_work_request(PROJECT* p) { DEBUG(msg_printf(p, MSG_INFO, "piggyback_work_request()");) clear_request(); if (config.fetch_minimal_work && gstate.had_or_requested_work) return; - if (p->dont_request_more_work) return; - if (p->suspended_via_gui) return; if (p->non_cpu_intensive) { if (!has_a_job(p)) { rsc_work_fetch[0].req_secs = 1; @@ -475,6 +474,16 @@ void WORK_FETCH::piggyback_work_request(PROJECT* p) { return; } + setup(); + + switch (p->pwf.cant_fetch_work_reason) { + case 0: + case CANT_FETCH_WORK_MIN_RPC_TIME: + break; + default: + return; + } + // if project was updated from manager and config says so, // fetch work for a resource even if there are higher-prio projects // able to fetch it @@ -484,8 +493,6 @@ void WORK_FETCH::piggyback_work_request(PROJECT* p) { check_higher_priority_projects = false; } - setup(); - // For each resource, scan projects in decreasing priority, // seeing if there's one that's higher-priority than this // able to fetch work for the resource.