From 47f8a509fe7054a122fd3603a10e825e85292109 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 26 Jan 2007 18:38:17 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=11981 --- checkin_notes | 18 ++++++++++++++++++ client/client_state.h | 1 + client/cpu_sched.C | 15 --------------- client/cs_scheduler.C | 21 +++++++++++++++++++++ doc/boinc_dev.php | 1 + doc/translation.php | 2 +- sched/file_upload_handler.C | 25 +++++++++++++++++++------ 7 files changed, 61 insertions(+), 22 deletions(-) diff --git a/checkin_notes b/checkin_notes index e11f440428..23f14d5b61 100755 --- a/checkin_notes +++ b/checkin_notes @@ -1241,3 +1241,21 @@ Rom 26 Jan 2007 win_build/ boincmgr_curl.vcproj boincmgr_curl_2003.vcproj + +David 26 Jan 2007 + - core client: another attempt at fixing the problem + where a project is issuing work but not uploading files. + New solution: don't fetch work from a project with + more than 2*ncpus results in FILES_UPLOADING state. + + Note: this doesn't address John McLeod's point that + we shouldn't increase LTD for projects in this state. + - file upload handler: print more accurate message when + fread() returns less than requested + + client/ + client_state.h + cpu_sched.C + cs_scheduler.C + sched/ + file_upload_handler.C diff --git a/client/client_state.h b/client/client_state.h index f336c625d9..913fea8062 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -389,6 +389,7 @@ private: int proj_min_results(PROJECT*, double); void generate_new_host_cpid(); void check_project_timeout(); + void compute_nuploading_results(); // --------------- cs_statefile.C: public: diff --git a/client/cpu_sched.C b/client/cpu_sched.C index 16ab76cf18..d205c1149a 100644 --- a/client/cpu_sched.C +++ b/client/cpu_sched.C @@ -136,14 +136,6 @@ void CLIENT_STATE::assign_results_to_projects() { project = rp->project; if (project->next_runnable_result) continue; - - // don't start results if project has > 2*ncpus uploading results. - // This avoids creating an unbounded number of completed - // results for a project that can download and compute - // faster than it can upload. - // - if (project->nuploading_results > 2*ncpus) continue; - project->next_runnable_result = rp; } @@ -439,15 +431,8 @@ void CLIENT_STATE::schedule_cpus() { for (i=0; inext_runnable_result = NULL; - p->nuploading_results = 0; p->anticipated_debt = p->short_term_debt; p->deadlines_missed = p->rr_sim_deadlines_missed; - } - for (i=0; istate() == RESULT_FILES_UPLOADING) { - rp->project->nuploading_results++; - } } for (i=0; itoo_large = false; diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index f49ef9d8cb..ab473d756d 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -711,6 +711,12 @@ bool CLIENT_STATE::compute_work_requests() { } continue; } + if (p->nuploading_results > 2*ncpus) { + if (log_flags.work_fetch_debug) { + msg_printf(p, MSG_INFO, "[work_fetch_debug] project has %d uploading results", p->nuploading_results); + } + continue; + } // see if this project is better than our current best // @@ -1337,4 +1343,19 @@ void CLIENT_STATE::generate_new_host_cpid() { } } +void CLIENT_STATE::compute_nuploading_results() { + unsigned int i; + + for (i=0; inuploading_results = 0; + } + for (i=0; istate() == RESULT_FILES_UPLOADING) { + rp->project->nuploading_results++; + } + } +} + + const char *BOINC_RCSID_d35a4a7711 = "$Id$"; diff --git a/doc/boinc_dev.php b/doc/boinc_dev.php index a8d3e367b7..1e35963c1b 100644 --- a/doc/boinc_dev.php +++ b/doc/boinc_dev.php @@ -109,6 +109,7 @@ Write a simulator for the CPU scheduler and work fetch policies
  • Prevent disk space usage from exceeding user preferences, and enforce resource shares, with file deletion according to project policy. +
  • Make messages of class MSG_USER_ERROR translatable.
  • BOINC Manager: diff --git a/doc/translation.php b/doc/translation.php index 5345b4ecb3..fe4f5ef2da 100644 --- a/doc/translation.php +++ b/doc/translation.php @@ -31,7 +31,7 @@ Usually this is en.po (English).
  • Create a translation file for your language. You can do this using a text editor or a specialized tool such as -poedit. +poedit.
  • Send this to the translation manager, who will then install it on the project's web site. diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index d4ef761dd9..f69d360abd 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -201,14 +201,13 @@ int copy_socket_to_file(FILE* in, char* path, double offset, double nbytes) { while (bytes_left > 0) { - int n, m, to_write, errno_save; + int n, m, to_write; m = bytes_left<(double)BLOCK_SIZE ? (int)bytes_left : BLOCK_SIZE; // try to get m bytes from socket (n>=0 is number actually returned) // n = fread(buf, 1, m, in); - errno_save=errno; // try to write n bytes to file // @@ -225,13 +224,27 @@ int copy_socket_to_file(FILE* in, char* path, double offset, double nbytes) { } // check that we got all bytes from socket that were requested + // Note: fread() reads less than requested only if there's + // an error or EOF (see the man page) // if (n != m) { close(fd); - return return_error(ERR_TRANSIENT, - "socket read incomplete: asked for %d, got %d: %s\n", - m, n, strerror(errno_save) - ); + if (feof(in)) { + return return_error(ERR_TRANSIENT, + "EOF on socket read : asked for %d, got %d\n", + m, n + ); + } else if (ferror(in)) { + return return_error(ERR_TRANSIENT, + "error %d (%s) on socket read: asked for %d, got %d\n", + ferror(in), strerror(ferror(in)), m, n + ); + } else { + return return_error(ERR_TRANSIENT, + "incomplete socket read: asked for %d, got %d\n", + m, n + ); + } } bytes_left -= n;