From eb10de5e40520adac8eec5cf8b7f1589ba91de36 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 23 Nov 2005 03:23:13 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=8913 --- checkin_notes | 9 +++++++++ client/app_control.C | 24 +++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/checkin_notes b/checkin_notes index b97a5d3fa9..af79e91c26 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13824,3 +13824,12 @@ David 22 Nov 2005 html/user/ host_edit_action.php + +David 22 Nov 2005 + - core client: fix bug where only 1 app would have its disk space + check against limit. + Also, do the check every 5 min instead of 1 min + (from Walt Gribben) + + client/ + app_control.C diff --git a/client/app_control.C b/client/app_control.C index 63a20472d3..ceb83e404e 100644 --- a/client/app_control.C +++ b/client/app_control.C @@ -503,19 +503,29 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() { unsigned int j; ACTIVE_TASK *atp; static double last_disk_check_time = 0; + bool do_disk_check = false; + bool did_anything = false; + // disk_interval is typically 60 sec, + // and some slot dirs have lots of files. + // So only check every 5*disk_interval + // + if (gstate.now > last_disk_check_time + 5*gstate.global_prefs.disk_interval) { + do_disk_check = true; + } for (j=0;jtask_state != PROCESS_EXECUTING) continue; - if (atp->check_max_cpu_exceeded()) return true; - else if (atp->check_max_mem_exceeded()) return true; - else if (gstate.now>last_disk_check_time + gstate.global_prefs.disk_interval) { - last_disk_check_time = gstate.now; - if (atp->check_max_disk_exceeded()) return true; + if (atp->check_max_cpu_exceeded()) did_anything = true; + else if (atp->check_max_mem_exceeded()) did_anything = true; + else if (do_disk_check && atp->check_max_disk_exceeded()) { + did_anything = true; } } - - return false; + if (do_disk_check) { + last_disk_check_time = gstate.now; + } + return did_anything; } // If process is running, send it a kill signal