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
This commit is contained in:
hsc
2012-09-25 16:14:22 +00:00
parent 65eb44a746
commit d45965753d

View File

@ -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