From 47da270349b8c57770f7f56994ce5f2f09a75c6f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 11 May 2004 04:39:25 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3363 --- checkin_notes | 22 +++++++++++++++++++--- client/app.C | 8 +++++++- doc/create_project.php | 1 + lib/exception.h | 1 + lib/util.C | 4 ++-- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index 86c8f7a2c7..ac137035fe 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12115,9 +12115,9 @@ David May 5 2004 Makefile.am,in Rom May 5 2004 - - Our exit stragety should be the same for Windows and Unix. The signal - handler should use the same global flags as Windows for suspending - and resuming activities. + - Our exit strategy should be the same for Windows and Unix. + The signal handler should use the same global flags as Windows + for suspending and resuming activities. client/ main.C @@ -12138,3 +12138,19 @@ Rom May 6 2004 failure_result_summary_by_platform.php index.php pass_percentage_by_platform.php + +David May 10 2004 + - extend the set of signals that are treated as "external", + i.e. if an app exits with one of these, put it in limbo + rather than treating it as error: + SIGHUP, SIGINT, SIGQUIT, SIGKILL, SIGTERM, SiGSTOP + Note: some of these should in principle never happen + because they're caught by the API. + But it doesn't hurt to be safe. + - update_average(): avoid divides by zero + + client/ + app.C + lib/ + exception.h + util.C diff --git a/client/app.C b/client/app.C index e4834f0824..335e3e6446 100644 --- a/client/app.C +++ b/client/app.C @@ -752,7 +752,13 @@ bool ACTIVE_TASK_SET::check_app_exited() { // if the process was externally killed, allow it to restart. // - if (signal==SIGKILL || signal==SIGQUIT) { + switch(signal) { + case SIGHUP: + case SIGINT: + case SIGQUIT: + case SIGKILL: + case SIGTERM: + case SIGSTOP: atp->state = PROCESS_IN_LIMBO; return true; } diff --git a/doc/create_project.php b/doc/create_project.php index fb312c712e..94c765e2b9 100644 --- a/doc/create_project.php +++ b/doc/create_project.php @@ -41,6 +41,7 @@ How to develop or port an application program for use with BOINC.
  • The BOINC API
  • The BOINC graphics API
  • Application development +
  • FORTRAN applications diff --git a/lib/exception.h b/lib/exception.h index a062acf012..91e9cb7edf 100644 --- a/lib/exception.h +++ b/lib/exception.h @@ -23,6 +23,7 @@ #ifndef _WIN32 #include using namespace std; +using std::exception; #endif diff --git a/lib/util.C b/lib/util.C index 9819b912c6..4415dbc3df 100755 --- a/lib/util.C +++ b/lib/util.C @@ -612,14 +612,14 @@ void update_average( if (avg_time) { double diff = now - avg_time; + if (diff==0) diff=3600; // just in case double diff_days = diff/SECONDS_PER_DAY; double weight = exp(-diff*M_LN2/half_life); avg *= weight; avg += (1-weight)*(work/diff_days); - } else { + } else if (work) { double dd = (now - work_start_time)/SECONDS_PER_DAY; avg = work/dd; } avg_time = now; } -