diff --git a/checkin_notes b/checkin_notes index fa41be0b6e..d0e7a4c67d 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8518,3 +8518,16 @@ David 25 June 2005 client/ cs_scheduler.C + +David 25 June 2005 + - add an exit_status parameter to ACTIVE_TASK::abort_task. + This may be either ERR_ABORTED_VIA_GUI or ERR_RSC_LIMIT_EXCEEDED + Without this, results aborted for either reason + end up with exit_status = ERR_RESULT_START + (bug reported by Bruce Allen) + + client/ + app.h + app_control.C + client_state.C + gui_rpc_server_C diff --git a/client/app.h b/client/app.h index 4d42fd7db1..362d38f6d6 100644 --- a/client/app.h +++ b/client/app.h @@ -148,13 +148,21 @@ public: void close_process_handles(); void cleanup_task(); - int start(bool first_time); // start the task running - int request_exit(); // Send a SIGQUIT signal or equivalent + int start(bool first_time); // start a process + int request_exit(); + // ask the process to exit gracefully, + // i.e. by sending a message bool process_exists(); - int kill_task(); // send a SIGKILL signal or equivalent - int suspend(); // send a SIGSTOP signal or equivalent - int unsuspend(); // send a SIGCONT signal or equivalent - int abort_task(const char*); // flag as abort pending and send kill signal + int kill_task(); + // Kill process forcibly, + // Unix: send a SIGKILL signal, Windows: TerminateProcess() + int suspend(); + // ask a process to stop executing (but stay in mem) + // Done by sending it a message + int unsuspend(); + // Undo a suspend: send a message + int abort_task(int exit_status, const char*); + // can be called whether or not process exists bool has_task_exited(); // return true if this task has exited int preempt(bool quit_task); // preempt (via suspend or quit) a running task int resume_or_start(); diff --git a/client/app_control.C b/client/app_control.C index e710689735..9d61053f45 100644 --- a/client/app_control.C +++ b/client/app_control.C @@ -441,7 +441,7 @@ bool ACTIVE_TASK::check_max_cpu_exceeded() { "Aborting result %s: exceeded CPU time limit %f\n", result->name, max_cpu_time ); - abort_task("Maximum CPU time exceeded"); + abort_task(ERR_RSC_LIMIT_EXCEEDED, "Maximum CPU time exceeded"); return true; } return false; @@ -465,7 +465,7 @@ bool ACTIVE_TASK::check_max_disk_exceeded() { "Aborting result %s: exceeded disk limit: %f > %f\n", result->name, disk_usage, max_disk_usage ); - abort_task("Maximum disk usage exceeded"); + abort_task(ERR_RSC_LIMIT_EXCEEDED, "Maximum disk usage exceeded"); return true; } } @@ -484,7 +484,7 @@ bool ACTIVE_TASK::check_max_mem_exceeded() { result->name, min(max_mem_usage, gstate.global_prefs.max_memory_mbytes*1048576) ); - abort_task("Maximum memory usage exceeded"); + abort_task(ERR_RSC_LIMIT_EXCEEDED, "Maximum memory usage exceeded"); return true; } return false; @@ -500,7 +500,7 @@ bool ACTIVE_TASK::check_max_mem_exceeded() { rss_bytes, max_mem_usage ); - //abort_task("Maximum memory usage exceeded"); + //abort_task(ERR_RSC_LIMIT_EXCEEDED, "Maximum memory usage exceeded"); return true; } return false; @@ -546,13 +546,14 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() { // If process is running, send it a kill signal // This is done when app has exceeded CPU, disk, or mem limits // -int ACTIVE_TASK::abort_task(const char* msg) { +int ACTIVE_TASK::abort_task(int exit_status, const char* msg) { if (task_state == PROCESS_EXECUTING || task_state == PROCESS_SUSPENDED) { task_state = PROCESS_ABORT_PENDING; kill_task(); } else { task_state = PROCESS_ABORTED; } + result->exit_status = exit_status; gstate.report_result_error(*result, msg); return 0; } @@ -817,7 +818,7 @@ void ACTIVE_TASK_SET::kill_tasks(PROJECT* proj) { } } -// suspend a task +// send a message // int ACTIVE_TASK::suspend() { if (!app_client_shm.shm) return 0; diff --git a/client/client_state.C b/client/client_state.C index 6250c091bd..39c30ca8fb 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -1065,9 +1065,7 @@ bool CLIENT_STATE::time_to_exit() { // (so don't crash over and over) // - Append a description of the error to result.stderr_out // -int CLIENT_STATE::report_result_error( - RESULT& res, const char* format, ... -) { +int CLIENT_STATE::report_result_error(RESULT& res, const char* format, ...) { char buf[MAX_BLOB_LEN], err_msg[MAX_BLOB_LEN]; unsigned int i; int failnum; diff --git a/client/gui_rpc_server.C b/client/gui_rpc_server.C index db23553209..48e01a04b0 100644 --- a/client/gui_rpc_server.C +++ b/client/gui_rpc_server.C @@ -391,7 +391,7 @@ static void handle_result_op(char* buf, MIOFILE& fout, const char* op) { if (!strcmp(op, "abort")) { atp = gstate.lookup_active_task_by_result(rp); if (atp) { - atp->abort_task("aborted via GUI RPC"); + atp->abort_task(ERR_ABORTED_VIA_GUI, "aborted via GUI RPC"); } else { rp->aborted_via_gui = true; } diff --git a/doc/download.php b/doc/download.php index c1d5699740..9aba5ace10 100755 --- a/doc/download.php +++ b/doc/download.php @@ -118,10 +118,10 @@ function show_version($pname, $i, $v) { Download ($s MB) - $type + Instructions: $type - details + version details "; diff --git a/doc/versions.inc b/doc/versions.inc index c40bb4ce26..062e381719 100644 --- a/doc/versions.inc +++ b/doc/versions.inc @@ -128,7 +128,7 @@ $w419 = array( $m443 = array( "num"=>"4.43", - "status"=>"Recommended version (advanced GUI)", + "status"=>"Recommended version (standard GUI)", "file"=>"boinc_4.43_macOSX.zip", "date"=>"21 May 2005", "type"=>mac_advanced(), @@ -141,7 +141,7 @@ $m443 = array( $m443c = array( "num"=>"4.43", - "status"=>"Recommended version (command line, no GUI)", + "status"=>"Unix command-line version", "file"=>"boinc_4.43_powerpc-apple-darwin.zip", "date"=>"21 May 2005", "type"=>bare_core(),