From 73ee79054526bf6222b536abd5c2379012938f09 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 4 Feb 2004 23:18:14 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2960 --- checkin_notes | 22 +++++++++++ client/app.C | 51 ++++++++++++++++--------- client/app.h | 1 + client/cs_scheduler.C | 7 +++- doc/db_dump.php | 6 +++ doc/ssl_client_release_instructions.txt | 10 ++++- doc/tools_work.php | 2 + 7 files changed, 79 insertions(+), 20 deletions(-) diff --git a/checkin_notes b/checkin_notes index 2adcd71cc8..fac929255a 100755 --- a/checkin_notes +++ b/checkin_notes @@ -9760,3 +9760,25 @@ David Feb 4 2004 Karl 2004-02-03 - more misc. make_project fixes + +David Feb 4 2004 + - define a destructor for ACTIVE_TASK. + Do all resource deallocation (close thread/proc/msg handles; + detach and/or destroy shmem) here. + This deallocation was being done piecemeal; + for example, it wasn't being done if the process was aborted. + Hence the "quit message" object was still there, + and when another process started in the same slot it would + immediately get the message (caused "reset project" problem) + - Eventually delete all ACTIVE_TASK objects. + The following removed them from the list but didn't deleting: + ACTIVE_TASK_SET::abort_project() + ACTIVE_TASK_SET::restart_tasks() (failure case) + - Don't ask for work if we have any unfinished work. + This is a temporary kludge to prevent repeated work requests; + it means that min work buffer is meaningless. + But maybe this is OK. + + client/ + app.h,C + cs_scheduler.C diff --git a/client/app.C b/client/app.C index ad7af73f6f..5128c57f2c 100644 --- a/client/app.C +++ b/client/app.C @@ -118,6 +118,35 @@ ACTIVE_TASK::ACTIVE_TASK() { checkpoint_cpu_time = 0; current_cpu_time = 0; working_set_size = 0; +#ifdef _WIN32 + pid_handle = 0; + thread_handle = 0; + quitRequestEvent = 0; + shm_handle = 0; +#endif +} + +ACTIVE_TASK::~ACTIVE_TASK() { +#ifdef _WIN32 + if (pid_handle) CloseHandle(pid_handle); + if (thread_handle) CloseHandle(thread_handle); + if (quitRequestEvent) CloseHandle(quitRequestEvent); + // detach from shared mem. + // This will destroy shmem seg since we're the last attachment + // + if (app_client_shm.shm) { + detach_shmem(shm_handle, app_client_shm.shm); + app_client_shm.shm = NULL; + } +#else + // detach from and destroy share mem + // + if (atp->app_client_shm.shm) { + detach_shmem(atp->app_client_shm.shm); + atp->app_client_shm.shm = NULL; + } + destroy_shmem(atp->shm_key); +#endif } int ACTIVE_TASK::init(RESULT* rp) { @@ -598,6 +627,7 @@ bool ACTIVE_TASK_SET::check_app_exited() { atp = active_tasks[i]; if (GetExitCodeProcess(atp->pid_handle, &exit_code)) { if (exit_code != STILL_ACTIVE) { + msg_printf(NULL, MSG_INFO, "Process exited with code %d", exit_code); atp->get_status_msg(); atp->result->final_cpu_time = atp->checkpoint_cpu_time; found = true; @@ -621,19 +651,9 @@ bool ACTIVE_TASK_SET::check_app_exited() { ); } } - CloseHandle(atp->pid_handle); - CloseHandle(atp->thread_handle); - CloseHandle(atp->quitRequestEvent); atp->read_stderr_file(); clean_out_dir(atp->slot_dir); - // detach from shared mem. This will destroy shmem seg - // since we're the last attachment - // - if (atp->app_client_shm.shm) { - detach_shmem(atp->shm_handle, atp->app_client_shm.shm); - atp->app_client_shm.shm = NULL; - } } } } @@ -695,14 +715,6 @@ bool ACTIVE_TASK_SET::check_app_exited() { atp->read_stderr_file(); clean_out_dir(atp->slot_dir); - // detach from and destroy share mem - // - if (atp->app_client_shm.shm) { - detach_shmem(atp->app_client_shm.shm); - atp->app_client_shm.shm = NULL; - } - destroy_shmem(atp->shm_key); - return true; } #endif @@ -931,6 +943,7 @@ int ACTIVE_TASK_SET::abort_project(PROJECT* project) { atp = *task_iter; if (atp->result->project == project) { task_iter = active_tasks.erase(task_iter); + delete atp; } else { task_iter++; } @@ -1048,6 +1061,7 @@ int ACTIVE_TASK::unsuspend() { // Remove an ACTIVE_TASK from the set. // Do this only if you're sure that the process has exited. +// Does NOT delete the ACTIVE_TASK object. // int ACTIVE_TASK_SET::remove(ACTIVE_TASK* atp) { vector::iterator iter; @@ -1094,6 +1108,7 @@ int ACTIVE_TASK_SET::restart_tasks() { "Couldn't restart the app for this result: %d", retval ); active_tasks.erase(iter); + delete atp; } else { iter++; } diff --git a/client/app.h b/client/app.h index b1425684b6..d89e425a78 100644 --- a/client/app.h +++ b/client/app.h @@ -104,6 +104,7 @@ public: int link_user_files(); ACTIVE_TASK(); + ~ACTIVE_TASK(); int init(RESULT*); int start(bool first_time); // start the task running diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 5ef276d046..2696a720b4 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -427,7 +427,12 @@ bool CLIENT_STATE::scheduler_rpc_poll() { if (exit_when_idle && contacted_sched_server) { should_get_work = false; } else { - below_work_buf_min = (current_work_buf_days() <= global_prefs.work_buf_min_days); + // TODO: the following is a kludge to prevent + // repeated work requests, but it defeats the + // work_buf_min concept + // + //below_work_buf_min = (current_work_buf_days() <= global_prefs.work_buf_min_days); + below_work_buf_min = (current_work_buf_days() == 0); should_get_work = below_work_buf_min && some_project_rpc_ok(); } if (should_get_work) { diff --git a/doc/db_dump.php b/doc/db_dump.php index 53939c3990..9a93893685 100644 --- a/doc/db_dump.php +++ b/doc/db_dump.php @@ -21,6 +21,12 @@ To increase the efficiency of data access, views are broken into a number of files, each containing a fixed number of records.

+For files that are ordered by ID, +each file contains a fixed-size segment of the ID range, +not a fixed number of records. +If the database ID allocation has gaps, +files will have fewer than this number of records. +

The entries in a given file are in either 'summary' or 'detail' form. For example, the summary of a team gives its ID, name, and credit, while the detailed from also contains a list of its members. diff --git a/doc/ssl_client_release_instructions.txt b/doc/ssl_client_release_instructions.txt index 505dbc4f3f..7bf00faf2b 100644 --- a/doc/ssl_client_release_instructions.txt +++ b/doc/ssl_client_release_instructions.txt @@ -49,15 +49,23 @@ Administrivia: Build Windows: + NOTE: currently we are distributing the debug version of the core client. + This is reflected in: + - where you copy dbghelp.dll to + - the "File Groups" tab of Installshield (link type) + Use the HP Kayak windows box (bart) in 329 or the Dell (skinner) in 325. set up: bart: Open 'quarl' on the desktop. skinner: Open 'build' on the desktop. - other: check out new source tree; copy Media.zip into win_build/installer; unzip + other: + check out new source tree + copy Media.zip into win_build/installer; unzip make sure "Media" is at top level of installer Right-click on top BOINC folder; CVS/preferences/policy; clear "prune empty folders" checkbox + copy "client/win/dbghelp.dll" to "win_build/Build/Debug" Open 'BOINC' diff --git a/doc/tools_work.php b/doc/tools_work.php index 08601d3236..87bfd30d0f 100644 --- a/doc/tools_work.php +++ b/doc/tools_work.php @@ -16,6 +16,8 @@ create_work -redundancy n // # of results to create -db_name x // database name -db_passwd x // database password + -db_host x // database host + -db_user x // database user name -upload_url x // URL for output file upload -download_url x // base URL for input file download -download_dir x // where to move input files