-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23912/#review49980
-----------------------------------------------------------



src/tests/slave_tests.cpp
<https://reviews.apache.org/r/23912/#comment87433>

    s/killTaskFunction/killTask/



src/tests/slave_tests.cpp
<https://reviews.apache.org/r/23912/#comment87434>

    s/process::// ?



src/tests/slave_tests.cpp
<https://reviews.apache.org/r/23912/#comment87447>

    These expectations should be set before you call driver.launchTasks().



src/tests/slave_tests.cpp
<https://reviews.apache.org/r/23912/#comment87446>

    Do you have to send killTask() before runTask() is called? AFAICT, you just 
need to make sure to call it before _runTask(). If yes, it's simpler (no need 
for closures and static functions) to satisfy a future here when _runTask() is 
called and call killTask().
    
      Future<Nothing> _runTask;
      EXPECT_CALL(slave, _runTask(_, _, _, _, _))
        .WillOnce(DoAll(
          FutureSatisfy<&_runTask>,
          SaveArg<0>(&future),
          SaveArg<1>(&frameworkInfo),
          SaveArg<2>(&frameworkId)));
    
    
        EXPECT_CALL(slave, runTask(_, _, _, _, _))
        .WillOnce(Invoke(&slave, &MockSlave::unmocked_runTask));
    
       AWAIT_READY(_runTask);
       driver.killTask();


- Vinod Kone


On Aug. 6, 2014, 11:51 p.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23912/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2014, 11:51 p.m.)
> 
> 
> Review request for mesos.
> 
> 
> Bugs: MESOS-947
>     https://issues.apache.org/jira/browse/MESOS-947
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Fixes MESOS-947 "Slave should properly handle a killTask() that arrives 
> between runTask() and _runTask()".
> 
> Slave::killTask() did not check for task in question combination to be 
> "pending" (i.e. Slave::runTask had happened, but Slave::_runTask had not yet) 
> and then erroneously assumed that Slave::runTask() had not been executed. The 
> task was then marked "LOST" instead of "KILLED". But Slave::runTask had 
> already scheduled Slave::_runTask to follow. Now the entry for being 
> "pending" is removed, and the task is marked "KILLED", and _runTask gets 
> informed about this. It checks whether the task in question is currently 
> "pending" and if it is not, then it infers that the task has been killed and 
> does not erroneously try to complete launching it.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp a896bb66db5d8cd27ef02b6498c9db93cb0d525f 
>   src/slave/slave.cpp 1d5691836822c8587e1aa8ed24860a8012c67a6e 
>   src/tests/mesos.hpp 75c66fda2485afa0d4541e710780d90b3411839a 
>   src/tests/mesos.cpp 35c94fa908ad728ea92a7d1bfcbe90d57b1b83d9 
>   src/tests/slave_tests.cpp e45255a6f699e51bf09397da95a5a11edbabe591 
> 
> Diff: https://reviews.apache.org/r/23912/diff/
> 
> 
> Testing
> -------
> 
> Wrote a unit test that reliably created the situation described in the 
> ticket. Observed that TASK_LOST and the listed log output occurred. This 
> pointed directly to the lines in killTask() where the problem is rooted. Ran 
> the test after fixing, it succeeded. Checked the log. It looks like a "clean 
> kill" now :-)
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>

Reply via email to