From 22e3bd7a26f9c722d54d97e780ffdbc2fc8c9f98 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 14 Jan 2003 23:42:47 +0000 Subject: [PATCH] sched server logging svn path=/trunk/boinc/; revision=810 --- checkin_notes | 8 ++++++++ sched/handle_request.C | 24 ++++++++++++++++++------ sched/main.C | 13 +++---------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/checkin_notes b/checkin_notes index 246ccab839..48a98e0c8f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -2952,3 +2952,11 @@ David Jan 14 2003 road_map.html single_host_server.html test.html + +David Jan 14 2003 + - Added log writes to sched server in some error cases + - Removed -use_files flag to sched server. Use compile-time flag instead. + + sched/ + handle_request.C + main.C diff --git a/sched/handle_request.C b/sched/handle_request.C index 81151a24be..617323a923 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -110,9 +110,15 @@ int add_wu_to_reply( WORKUNIT wu2; app = ss.lookup_app(wu.appid); - if (!app) return -1; + if (!app) { + write_log("Can't find app\n"); + return -1; + } app_version = ss.lookup_app_version(app->id, platform.id, app->min_version); - if (!app_version) return -1; + if (!app_version) { + write_log("Can't find app version\n"); + return -1; + } // add the app, app_version, and workunit to the reply, // but only if they aren't already there @@ -124,7 +130,10 @@ int add_wu_to_reply( // wu2 = wu; // make copy since we're going to modify its XML field retval = insert_wu_tags(wu2, seconds_to_complete, *app); - if (retval) return retval; + if (retval) { + write_log("insert_wu_tags failed\n"); + return retval; + } reply.insert_workunit_unique(wu2); return 0; } @@ -421,9 +430,12 @@ int send_work( // the following should be a critical section // - if (!ss.wu_results[i].present || - !wu_is_feasible(ss.wu_results[i].workunit, reply.host) - ) { + if (!ss.wu_results[i].present) { + continue; + } + if (!wu_is_feasible(ss.wu_results[i].workunit, reply.host)) { + sprintf(buf, "WU %s is infeasible\n", ss.wu_results[i].workunit.name); + write_log(buf); continue; } diff --git a/sched/main.C b/sched/main.C index 179dd88e73..f53941d33f 100644 --- a/sched/main.C +++ b/sched/main.C @@ -20,7 +20,6 @@ // The BOINC scheduling server. // // command-line options: -// -use_files // use disk files for req/reply msgs (for debugging) #include #include @@ -43,6 +42,7 @@ using namespace std; #define STDERR_FILENAME "cgi_out" #define REQ_FILE_PREFIX "boinc_req_" #define REPLY_FILE_PREFIX "boinc_reply_" +bool use_files = false; // use disk files for req/reply msgs (for debugging) PROJECT gproject; CONFIG config; @@ -54,7 +54,7 @@ void write_log(char* p) { fprintf(stderr, "%s: %s", timestr, p); } -int main(int argc, char** argv) { +int main() { FILE* fin, *fout; int i, retval, pid; char buf[256], req_path[256], reply_path[256], path[256]; @@ -62,20 +62,13 @@ int main(int argc, char** argv) { void* p; unsigned int counter=0; char* code_sign_key; - bool found, use_files=false; + bool found; if (!freopen(STDERR_FILENAME, "a", stderr)) { fprintf(stderr, "Can't redirect stderr\n"); exit(1); } - - for (i=1; i