sched server logging

svn path=/trunk/boinc/; revision=810
This commit is contained in:
David Anderson 2003-01-14 23:42:47 +00:00
parent 833b7bcb2c
commit 22e3bd7a26
3 changed files with 29 additions and 16 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -20,7 +20,6 @@
// The BOINC scheduling server.
//
// command-line options:
// -use_files // use disk files for req/reply msgs (for debugging)
#include <iostream>
#include <vector>
@ -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<argc; i++) {
if (!strcmp(argv[i], "-use_files")) {
use_files = true;
}
}
retval = config.parse_file();
if (retval) {
write_log("Can't parse config file\n");