From 4111c5696c4f6fbad225363c5fd1cb52801d78cb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 29 Nov 2011 04:47:10 +0000 Subject: [PATCH] - scheduler: fix crashing bug (don't memset SCHED_REQUEST). svn path=/trunk/boinc/; revision=24660 --- checkin_notes | 10 ++++++++++ sched/handle_request.cpp | 1 - sched/sched_result.cpp | 2 -- sched/sched_types.cpp | 1 + ssim/ssim.cpp | 14 +++++++++++--- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index 965202a51c..a22931522e 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8706,3 +8706,13 @@ Charlie 28 Nov 2011 Events.h sg_PanelBase.cpp,.h sg_TaskPanel.cpp,.h + +David 28 Nov 2011 + - scheduler: fix crashing bug (don't memset SCHED_REQUEST). + + sched/ + sched_result.cpp + handle_request.cpp + sched_types.cpp + ssim/ + ssim.cpp diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index e3e826ae82..ccd948dc89 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -1362,7 +1362,6 @@ void handle_request(FILE* fin, FILE* fout, char* code_sign_key) { g_reply = &sreply; g_wreq = &sreply.wreq; - memset(&sreq, 0, sizeof(sreq)); sreply.nucleus_only = true; log_messages.set_indent_level(1); diff --git a/sched/sched_result.cpp b/sched/sched_result.cpp index 96a20cf3cd..c56cdff3b6 100644 --- a/sched/sched_result.cpp +++ b/sched/sched_result.cpp @@ -96,7 +96,6 @@ int handle_results() { unsigned int i; int retval; RESULT* rp; - bool changed_host=false; if (g_request->results.size() == 0) return 0; @@ -283,7 +282,6 @@ int handle_results() { "[HOST#%d] [RESULT#%d] [WU#%d] Allowing result because same USER#%d\n", g_reply->host.id, srip->id, srip->workunitid, g_reply->host.userid ); - changed_host = true; } } // hostids do not match diff --git a/sched/sched_types.cpp b/sched/sched_types.cpp index 6002a738c9..52d906b00c 100644 --- a/sched/sched_types.cpp +++ b/sched/sched_types.cpp @@ -185,6 +185,7 @@ const char* SCHEDULER_REQUEST::parse(XML_PARSER& xp) { core_client_major_version = 0; core_client_minor_version = 0; core_client_release = 0; + core_client_version = 0; rpc_seqno = 0; work_req_seconds = 0; cpu_req_secs = 0; diff --git a/ssim/ssim.cpp b/ssim/ssim.cpp index b8c416734e..c37a74423c 100644 --- a/ssim/ssim.cpp +++ b/ssim/ssim.cpp @@ -36,13 +36,13 @@ // We simulate policies based on coding and replication. // // Coding means that data is divided into M = N+K units, -// of which any N are sufficient to reconstruct the data. +// of which any N are sufficient to reconstruct the original data. // // The units in an encoding can themselves be encoded. // In general we model C levels of encoding. // // The bottom-level data units ("chunks") are stored on hosts, -// with R-fold replication +// possibly with replication #define ENCODING_N 4 #define ENCODING_K 2 @@ -123,6 +123,9 @@ struct CHUNK_ON_HOST : public EVENT { bool present_on_host; bool transfer_in_progress; // upload if present_on_host, else download virtual void handle(); + inline bool download_in_progress() { + return (transfer_in_progress && !present_on_host); + } }; static int next_host_id=0; @@ -219,7 +222,12 @@ struct CHUNK : DATA_UNIT { } virtual void delete_chunks_from_server() { - printf("%0f: deleting %s from server\n", sim.now, name); + set::iterator i; + for (i=hosts.begin(); i!=hosts.end(); i++) { + CHUNK_ON_HOST* c = *i; + if (c->download_in_progress()) return; + } + printf("%.0f: deleting %s from server\n", sim.now, name); _is_present_on_server = false; } virtual void now_present() {