mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Rukletsov <ruklet...@gmail.com>
Subject Re: Review Request 64069: Ensured command executor always honors shutdown request.
Date Wed, 20 Dec 2017 20:14:43 GMT

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

(Updated Dec. 20, 2017, 8:14 p.m.)


Review request for mesos, Andrei Budnik, Anand Mazumdar, Armand Grillet, and Vinod Kone.


Repository: mesos


Description
-------

See summary.


Diffs (updated)
-----

  src/launcher/executor.cpp 31a47106d7f511220afba4fb382c9252d4671f6e 


Diff: https://reviews.apache.org/r/64069/diff/2/

Changes: https://reviews.apache.org/r/64069/diff/1-2/


Testing
-------

Writing a proper test is tricky: our test harness does not allow to drop outgoing messages
and hence `RunTaskMessage` from the agent to the executor can't be dropped (since executor
is running in a separate process it can't be dropped there as incoming message either). So
I've tested this manually via dropping `RunTaskMessage` in `exec.cpp` and using the following
test:
```
TEST_P(CommandExecutorTest, ShutdownWithNoLaunch)
{
  Try<Owned<cluster::Master>> master = StartMaster();
  ASSERT_SOME(master);

  Owned<MasterDetector> detector = master.get()->createDetector();

  slave::Flags flags = CreateSlaveFlags();
  flags.http_command_executor = false;

  Try<Owned<cluster::Slave>> slave = StartSlave(detector.get(), flags);
  ASSERT_SOME(slave);

  MockScheduler sched;
  MesosSchedulerDriver driver(
      &sched, DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);

  EXPECT_CALL(sched, registered(&driver, _, _));

  Future<vector<Offer>> offers;
  EXPECT_CALL(sched, resourceOffers(&driver, _))
    .WillOnce(FutureArg<1>(&offers))
    .WillRepeatedly(Return()); // Ignore subsequent offers.

  driver.start();

  AWAIT_READY(offers);
  EXPECT_EQ(1u, offers->size());

  // Launch a task with the command executor.
  TaskInfo task = createTask(
      offers->front().slave_id(),
      offers->front().resources(),
      SLEEP_COMMAND(1000));

  driver.launchTasks(offers->front().id(), {task});

  driver.stop();
  driver.join();
}
```


Thanks,

Alexander Rukletsov


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message