From 377ef87c0fb4a6d1a66c53e41ee02bc2eb1a33c4 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 15 Mar 2013 11:26:02 -0700 Subject: [PATCH 1/3] - remote job submission: fix remote file mode, and improve error reporting --- html/inc/submit.inc | 9 +++++++-- html/user/submit_rpc_handler.php | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/html/inc/submit.inc b/html/inc/submit.inc index 8d4b42209f..dbf8d6a58b 100644 --- a/html/inc/submit.inc +++ b/html/inc/submit.inc @@ -100,7 +100,12 @@ function do_http_op($req, $xml, $op) { if (!$reply) return array(null, "HTTP error"); $r = simplexml_load_string($reply); if (!$r) return array(null, "Can't parse reply XML:
".htmlentities($reply)."
"); - return array($r, null); + $e = (string)$r->error_msg; + if ($e) { + return array(null, $e); + } else { + return array($r, null); + } } function do_batch_op($req, $op) { @@ -149,7 +154,7 @@ function boinc_submit_batch($req) { if ($name == 'batch_id') { return array((int)$reply, null); } else if ($name == 'error') { - return array(null, (string)$reply->message); + return array(null, (string)$reply->err_message); } else { return array(null, "Bad reply message"); } diff --git a/html/user/submit_rpc_handler.php b/html/user/submit_rpc_handler.php index 2f71869440..0d93c3a279 100644 --- a/html/user/submit_rpc_handler.php +++ b/html/user/submit_rpc_handler.php @@ -93,6 +93,7 @@ function stage_file($file) { global $fanout; switch ($file->mode) { + case "remote": case "local": $md5 = md5_file($file->source); if (!$md5) { @@ -107,8 +108,6 @@ function stage_file($file) { return $name; case "local_staged": return $file->source; - case "remote": - xml_error(-1, "remote file mode not implemented"); case "semilocal": xml_error(-1, "semilocal file mode not implemented"); } From 16738c6f3099392ed741e46b9fa8b03cfa818648 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 15 Mar 2013 12:03:12 -0700 Subject: [PATCH 2/3] - remote job submission: don't confuse remote and semilocal file modes --- html/user/submit_example.php | 2 +- html/user/submit_rpc_handler.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/html/user/submit_example.php b/html/user/submit_example.php index 5b0998defc..6063991aa6 100644 --- a/html/user/submit_example.php +++ b/html/user/submit_example.php @@ -248,7 +248,7 @@ function form_to_request() { $req->jobs = Array(); $f->source = $input_url; - $f->mode = "remote"; + $f->mode = "semilocal"; for ($x=$param_lo; $x<$param_hi; $x += $param_inc) { $job = null; diff --git a/html/user/submit_rpc_handler.php b/html/user/submit_rpc_handler.php index 0d93c3a279..a01d2bc407 100644 --- a/html/user/submit_rpc_handler.php +++ b/html/user/submit_rpc_handler.php @@ -93,7 +93,7 @@ function stage_file($file) { global $fanout; switch ($file->mode) { - case "remote": + case "semilocal": case "local": $md5 = md5_file($file->source); if (!$md5) { @@ -108,10 +108,8 @@ function stage_file($file) { return $name; case "local_staged": return $file->source; - case "semilocal": - xml_error(-1, "semilocal file mode not implemented"); } - xml_error(-1, "unknown file mode $file->mode"); + xml_error(-1, "unsupported file mode: $file->mode"); } // stage all the files From 1ef582aad6f472d4e2cefc03c4f16550ab4cb26b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 16 Mar 2013 20:41:58 -0700 Subject: [PATCH 3/3] - client: improve work fetch messages - web: include user ID in email to moderators about banishment --- client/work_fetch.cpp | 15 +++++++++++---- html/inc/forum_email.inc | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index e7a48af999..7961d2097d 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -209,7 +209,7 @@ PROJECT* RSC_WORK_FETCH::choose_project_hyst( if (log_flags.work_fetch_debug) { msg_printf(0, MSG_INFO, - "[work_fetch] %s: buffer_low: %s; sim_excluded_instances %d\n", + "[work_fetch] choose_project() for %s: buffer_low: %s; sim_excluded_instances %d\n", rsc_name(rsc_type), buffer_low?"yes":"no", sim_excluded_instances ); } @@ -355,9 +355,10 @@ void RSC_WORK_FETCH::set_request(PROJECT* p) { req_instances = nidle_now; if (log_flags.work_fetch_debug) { - msg_printf(0, MSG_INFO, - "[work_fetch] set_request(): ninst %d nused_total %f nidle_now %f fetch share %f req_inst %f", - ninstances, w.nused_total, nidle_now, w.fetchable_share, req_instances + msg_printf(p, MSG_INFO, + "[work_fetch] set_request() for %s: ninst %d nused_total %f nidle_now %f fetch share %f req_inst %f req_secs %f", + rsc_name(rsc_type), ninstances, w.nused_total, nidle_now, + w.fetchable_share, req_instances, req_secs ); } if (req_instances && !req_secs) { @@ -490,6 +491,12 @@ void RSC_WORK_FETCH::supplement(PROJECT* pp) { RSC_PROJECT_WORK_FETCH& rpwf = project_state(p); if (rpwf.anon_skip) continue; if (p->sched_priority > x) { + if (log_flags.work_fetch_debug) { + msg_printf(pp, MSG_INFO, + "[work_fetch]: not requesting work for %s: %s has higher priority", + rsc_name(rsc_type), p->get_project_name() + ); + } return; } } diff --git a/html/inc/forum_email.inc b/html/inc/forum_email.inc index 47e0534fa1..5a6f7a50dc 100644 --- a/html/inc/forum_email.inc +++ b/html/inc/forum_email.inc @@ -184,7 +184,7 @@ because your postings have not followed our guidelines. $body .= "\n\nThe moderator gave the following explanation about your suspension:\n"; $body .= $reason; } - $success = mail_report_list($forum, $user->name." has been banished.", $body); + $success = mail_report_list($forum, "$user->name (ID $user->id) has been banished.", $body); $success &= send_email($user, $subject, $body); pm_send($user, $user, $subject, $body, false); return $success;