scheduler: check if cpu_time and elapsed_time are infinite, set to zero if so

Some (old? buggy?) clients report these as infinity.
This causes the result update queries to fail.
This commit is contained in:
David Anderson 2014-03-18 20:19:04 -07:00
parent 834ac11661
commit 8aa10ee5a9
2 changed files with 13 additions and 4 deletions

View File

@ -539,10 +539,9 @@ int wait_client_mutex(const char* dir, double timeout) {
return retval;
}
bool boinc_is_finite(double x) {
inline bool boinc_is_finite(double x) {
#if defined (HPUX_SOURCE)
return _Isfinite(x);
return false;
#else
return finite(x) != 0;
#endif

View File

@ -1147,8 +1147,18 @@ int SCHED_DB_RESULT::parse_from_client(XML_PARSER& xp) {
}
if (xp.parse_str("name", name, sizeof(name))) continue;
if (xp.parse_int("state", client_state)) continue;
if (xp.parse_double("final_cpu_time", cpu_time)) continue;
if (xp.parse_double("final_elapsed_time", elapsed_time)) continue;
if (xp.parse_double("final_cpu_time", cpu_time)) {
if (!boinc_is_finite(cpu_time)) {
cpu_time = 0;
}
continue;
}
if (xp.parse_double("final_elapsed_time", elapsed_time)) {
if (!boinc_is_finite(elapsed_time)) {
elapsed_time = 0;
}
continue;
}
if (xp.parse_int("exit_status", exit_status)) continue;
if (xp.parse_int("app_version_num", app_version_num)) continue;
if (xp.match_tag("file_info")) {