From 618a5c165135b4ee52489f853f74c254671f68ba Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 23 Oct 2007 17:11:56 +0000 Subject: [PATCH] - assimilator: there was a bug in the situation where: 1) a WU is marked as ready for assimilation and has no errors; 2) it has no canonical result In this case, the assimilate handler gets called anyway, typically with the canonical result of the previous WU as arg. Note: this situation doesn't arise normally; it might happen if some results are deleted accidentally. The fix: - identify this situation, and set the WU.error_mask to a new code (WU_ERROR_NO_CANONICAL_RESULT) - zero out the "canonical_result" variable passed to the handler, so even if the handler fails to check wu.error_mask, at least it won't assimilate the same result twice. Thanks to Hendrik Verhoek for finding this bug. - DB schema: team table type is MyISAM, not InnoDB svn path=/trunk/boinc/; revision=13938 --- checkin_notes | 104 +++++++++++++++++++++++++++----------------- db/boinc_db.h | 1 + db/schema.sql | 2 +- doc/addon_data.php | 14 +++--- doc/boinc_news.php | 13 ++++++ sched/assimilator.C | 20 +++++++++ 6 files changed, 106 insertions(+), 48 deletions(-) diff --git a/checkin_notes b/checkin_notes index 173c2561ab..cb6d803e3f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9294,7 +9294,7 @@ David 7 Oct 2007 html/inc/ team.inc -Janus 8 Oct 2007 +Janus 8 Oct 2007 Bittorrent: - Changed the torrent generator behaviour from trying only the exact path to the file given to trying all paths given by removing the root of the @@ -9307,8 +9307,8 @@ Janus 8 Oct 2007 html/bt/ torrent_cache.php - database/ - bittorrent_peers.sql + database/ + bittorrent_peers.sql Rom 8 Oct 2007 - MGR: User errors are supposed to be red, not internal errors. @@ -9411,9 +9411,9 @@ Janus 10 Oct 2007 html/bt announce.php - scrape.php - inc/ - bittorrent_ipbans.sql (new) + scrape.php + inc/ + bittorrent_ipbans.sql (new) Charlie 10 Oct 2007 - Mac V5 GFX API: In setMacPList(), if resource already exists, don't @@ -9450,7 +9450,7 @@ Eric K. 11 Oct 2007 html/ user/ - create_profile.php + create_profile.php Charlie 11 Oct 2007 - V6 GFX: Call waitpid to prevent gfx_switcher leaving zombie processes. @@ -9617,26 +9617,26 @@ Charlie 16 Oct 2007 boinc_api.C David 17 Oct 2007 - - client: improve log messages + - client: improve log messages - client/ - cs_scheduler.C - pers_file_xfer.C - scheduler_op.C - clienttray/ - tray_win.cpp + client/ + cs_scheduler.C + pers_file_xfer.C + scheduler_op.C + clienttray/ + tray_win.cpp Charlie 18 Oct 2007 - - Fix compiler warning, + - Fix compiler warning, client/ cs_scheduler.C David 18 Oct 2007 - - client (win): fix time-zone code + - client (win): fix time-zone code - client/ - hostinfo_win.C + client/ + hostinfo_win.C Rom 18 Oct 2007 - Add the Global prefix to the shared memory segment that @@ -9700,12 +9700,12 @@ Eric K 19 Oct 2007 David 20 Oct 2007 - - client: cc_config.xml can contain one or more elements - specifying additional alternate platforms. + - client: cc_config.xml can contain one or more elements + specifying additional alternate platforms. - client/ - cs_platforms.C - log_flags.C,h + client/ + cs_platforms.C + log_flags.C,h Reinhard 21 Oct 2007 - configure.ac: fixed handling of curl-libs to avoid erroneous @@ -9749,30 +9749,30 @@ Rytis 22 Oct 2007 stats.php David 22 Oct 2007 - - API: some changes relevant only to SETI@home. + - API: some changes relevant only to SETI@home. - api/ - graphics2.h - reduce.h - reduce_lib.C - reduce_main.C + api/ + graphics2.h + reduce.h + reduce_lib.C + reduce_main.C David 22 Oct 2007 - - GUI RPC: fix format of request - - GUI RPC: don't enable network on bad request + - GUI RPC: fix format of request + - GUI RPC: don't enable network on bad request - client/ - gui_rpc_server_ops.C - lib/ - gui_rpc_client.C + client/ + gui_rpc_server_ops.C + lib/ + gui_rpc_client.C David 22 Oct 2007 - - client: remove unparsed XML error for - - client: remove spurious error if include in cc_config.xml + - client: remove unparsed XML error for + - client: remove spurious error if include in cc_config.xml - client/ - app.C - log_flags.C + client/ + app.C + log_flags.C Rom 23 Oct 2007 - client: read_file_string was modified sometime ago to support tail @@ -9781,3 +9781,27 @@ Rom 23 Oct 2007 client/ app_control.C + + +David 23 Oct 2007 + - assimilator: there was a bug in the situation where: + 1) a WU is marked as ready for assimilation and has no errors; + 2) it has no canonical result + In this case, the assimilate handler gets called anyway, + typically with the canonical result of the previous WU as arg. + Note: this situation doesn't arise normally; + it might happen if some results are deleted accidentally. + The fix: + - identify this situation, and set the WU.error_mask to a new code + (WU_ERROR_NO_CANONICAL_RESULT) + - zero out the "canonical_result" variable passed to the handler, + so even if the handler fails to check wu.error_mask, + at least it won't assimilate the same result twice. + Thanks to Hendrik Verhoek for finding this bug. + - DB schema: team table type is MyISAM, not InnoDB + + db/ + boinc_db.h + schema.sql + sched/ + assimilator.C diff --git a/db/boinc_db.h b/db/boinc_db.h index bbfe77f3f7..712fb98432 100644 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -324,6 +324,7 @@ struct HOST { #define WU_ERROR_TOO_MANY_SUCCESS_RESULTS 4 #define WU_ERROR_TOO_MANY_TOTAL_RESULTS 8 #define WU_ERROR_CANCELLED 16 +#define WU_ERROR_NO_CANONICAL_RESULT 32 struct WORKUNIT { int id; diff --git a/db/schema.sql b/db/schema.sql index 7ee2917adc..f4df1b55c2 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -115,7 +115,7 @@ create table team ( ping_user integer not null default 0, ping_time integer unsigned not null default 0, primary key (id) -) type=InnoDB; +) type=MyISAM; create table host ( id integer not null auto_increment, diff --git a/doc/addon_data.php b/doc/addon_data.php index 646b37d20f..4cc41e21f3 100644 --- a/doc/addon_data.php +++ b/doc/addon_data.php @@ -466,14 +466,14 @@ array('boinc_server_status.zip', ); $web = array( -array('boinc_lcs_2.1.tar.gz', +array('http://download.conmunix.net/pub/boinc_lcs/boinc_lcs_3.0_beta.tar.gz', 'Boinc LCS', - '', - 'Live Client State for an unlimited number of clients (needs a webserver)', - 'http://conmunich.dyndns.org/cm/development/boinc2/', - 'Mysql, Perl and PHP', - 'Shows the current status from up to 4 clients on a webserver. Files will be transported by a small Perl server within the network that runs on each client. You can configure all options over a Mysql backend.', - '1139033692' + '3.0 beta', + 'Shows the current state and other information from an unlimited number of BOINC clients connected to the Internet.', + 'http://www.conmunix.net/boinc-lcs', + 'Apache, PHP', + 'Boinc LCS is a free PHP based script, that allows you to monitor the current state (and other information) from each of your connected BOINC clients. It runs on a simple webserver and since version 2.1 it is also platform independent. Boinc LCS is released under the GNU/GPL license. You can modify and redistribute or just using it!', + '1193023938' ), array('boincphpgui-2.3.tar.gz', 'BoincPHP5-GUI', diff --git a/doc/boinc_news.php b/doc/boinc_news.php index 34729979a4..4f7271bd75 100644 --- a/doc/boinc_news.php +++ b/doc/boinc_news.php @@ -2,6 +2,19 @@ $project_news = array( +array("October 22, 2007", + "The BOINC-based BBC + Climate Change Experiment has won the prestigious + Prix Europa + award in the Internet category." +), +array("October 21, 2007", + 'Conmunix has released version 3.0 beta of + Boinc LCS + (Live Client State), a PHP script that allows you to monitor + the current state and other information from each of + your BOINC clients.' +), array("October 18, 2007", "BOINC user John Koulouris has written The Big BOINC! Projects and Chronology Page, a brief history of BOINC." diff --git a/sched/assimilator.C b/sched/assimilator.C index 06205f7613..fa8e540836 100644 --- a/sched/assimilator.C +++ b/sched/assimilator.C @@ -98,15 +98,35 @@ bool do_pass(APP& app) { ); sprintf(buf, "where workunitid=%d", wu.id); + canonical_result.clear(); + bool found = false; while (!result.enumerate(buf)) { results.push_back(result); if (result.id == wu.canonical_resultid) { canonical_result = result; + found = true; } } + // If no canonical result found and WU had no other errors, + // something is wrong, e.g. result records got deleted prematurely. + // This is probably unrecoverable, so mark the WU as having + // an assimilation error and keep going. + // + if (!found && !wu.error_mask) { + log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, + "[%s] no canonical result\n", wu.name + ); + wu.error_mask = WU_ERROR_NO_CANONICAL_RESULT; + sprintf(buf, "error_mask=%d", wu.error_mask); + wu.update_field(buf); + } + retval = assimilate_handler(wu, results, canonical_result); if (retval) { + // If handler failed, there's probably a volume offline + // or something like that. Better to quit. + // log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, "[%s] handler returned error %d; exiting\n", wu.name, retval );