From d45965753d0025164ef719d86ec340f87add73e3 Mon Sep 17 00:00:00 2001 From: hsc Date: Tue, 25 Sep 2012 16:14:22 +0000 Subject: [PATCH] bugfix: handle old clients properly Fix 1: A result message with a nonexistent or invalid run ID must be ignored in any case. 0 is only OK for NEED_WORK messages, clients communicating a result must know the ID. Fix 2: Tell the client the run ID in the first place ... git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1692 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- src/core/cpn/JobServer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/cpn/JobServer.cc b/src/core/cpn/JobServer.cc index ddde6113..c1637527 100644 --- a/src/core/cpn/JobServer.cc +++ b/src/core/cpn/JobServer.cc @@ -199,7 +199,7 @@ void CommThread::operator()() switch (ctrlmsg.command()) { case FailControlMessage_Command_NEED_WORK: - // let old clients die + // let old clients die (run_id == 0 -> possibly virgin client) if (!ctrlmsg.has_run_id() || (ctrlmsg.run_id() != 0 && ctrlmsg.run_id() != m_js.m_runid)) { cout << "!![Server] telling old client to die" << endl; ctrlmsg.Clear(); @@ -212,7 +212,7 @@ void CommThread::operator()() break; case FailControlMessage_Command_RESULT_FOLLOWS: // ignore old client's results - if (!ctrlmsg.has_run_id() || (ctrlmsg.run_id() != 0 && ctrlmsg.run_id() != m_js.m_runid)) { + if (!ctrlmsg.has_run_id() || ctrlmsg.run_id() != m_js.m_runid) { cout << "!![Server] ignoring old client's results" << endl; break; } @@ -240,6 +240,7 @@ void CommThread::sendPendingExperimentData(Minion& minion) { FailControlMessage ctrlmsg; ctrlmsg.set_build_id(42); + ctrlmsg.set_run_id(m_js.m_runid); ExperimentData * exp = 0; if (m_js.m_undoneJobs.Dequeue_nb(exp) == true) { // Got an element from queue, assign ID to workload and send to minion