You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Niklas Nielsen <ni...@qni.dk> on 2014/02/24 20:58:35 UTC
Review Request 18403: Added support for launching tasks by TaskInfo.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, TILL TOENSHOFF, and Vinod Kone.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp 6d990cb
src/slave/slave.hpp d82d4e9
src/slave/slave.cpp 7ad8232
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Ian Downes <ia...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review35428
-----------------------------------------------------------
This doesn't apply to master; could you please rebase and update.
{noformat}
[1011][idownes:mesos]$ git fetch origin
[1011][idownes:mesos]$ git status
# On branch master
nothing to commit, working directory clean
[1011][idownes:mesos]$ ./support/apply-review.sh 18403
--2014-02-25 10:11:50-- https://reviews.apache.org/r/18403/diff/raw/
Resolving reviews.apache.org... 140.211.11.74
Connecting to reviews.apache.org|140.211.11.74|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29338 (29K) [text/x-patch]
Saving to: ‘18403.patch’
100%[==================================================================================================================================================================================================================================================================================================================================>] 29,338 --.-K/s in 0.05s
2014-02-25 10:11:50 (527 KB/s) - ‘18403.patch’ saved [29338/29338]
error: patch failed: src/slave/slave.hpp:105
error: src/slave/slave.hpp: patch does not apply
Failed to apply patch
{noformat}
- Ian Downes
On Feb. 24, 2014, 7:58 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated Feb. 24, 2014, 7:58 p.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, TILL TOENSHOFF, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp 6d990cb
> src/slave/slave.hpp d82d4e9
> src/slave/slave.cpp 7ad8232
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 13, 2014, 3:05 p.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 853
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line853>
> >
> > hmm, my wording makes no sense but what I think I was concerned about who cleans up an Executor* under various conditions, e.g., below on 854 if the future is _not_ ready and we return what happens to the pointer?
Is this a general comment or related to the error message? Per Adam's suggestion, I changed the message to describe that a executor has already been launched.
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37117
-----------------------------------------------------------
On March 17, 2014, 10:37 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 17, 2014, 10:37 a.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Ian Downes <ia...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37117
-----------------------------------------------------------
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68457>
hmm, my wording makes no sense but what I think I was concerned about who cleans up an Executor* under various conditions, e.g., below on 854 if the future is _not_ ready and we return what happens to the pointer?
- Ian Downes
On Feb. 27, 2014, 6:07 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated Feb. 27, 2014, 6:07 p.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp 6d990cb
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp 4f5349b
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 13, 2014, 10:11 p.m., Adam B wrote:
> > src/slave/slave.cpp, line 3413
> > <https://reviews.apache.org/r/18403/diff/4/?file=519536#file519536line3413>
> >
> > Initializing resources in the constructor is great, but perhaps Executor::finalize(ExecInfo) should set resources = info.resources(); Then you wouldn't even need to set resources in the other constructor, since the call to finalize would do it for you.
> > Or maybe finalize needs to do a MergeFrom, in case the TaskInfo call-path already set resources before the executor could finish launching.
Great point! Thanks for catching this. Should be fixed in the latest patch.
> On March 13, 2014, 10:11 p.m., Adam B wrote:
> > src/slave/slave.cpp, lines 3074-3075
> > <https://reviews.apache.org/r/18403/diff/3-4/?file=506155#file506155line3074>
> >
> > This error message is confusing/inaccurate. The problem is that the executor is already known (executors does contain executorId). Somebody's trying to launch a task for an executor that's already running on that slave. Can you reword the error to clarify what the problem is?
True - I added more context to the error message in the new patch.
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37157
-----------------------------------------------------------
On March 17, 2014, 10:37 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 17, 2014, 10:37 a.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Adam B <ad...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37157
-----------------------------------------------------------
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68559>
return false here too?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68557>
This error message is confusing/inaccurate. The problem is that the executor is already known (executors does contain executorId). Somebody's trying to launch a task for an executor that's already running on that slave. Can you reword the error to clarify what the problem is?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68558>
Initializing resources in the constructor is great, but perhaps Executor::finalize(ExecInfo) should set resources = info.resources(); Then you wouldn't even need to set resources in the other constructor, since the call to finalize would do it for you.
Or maybe finalize needs to do a MergeFrom, in case the TaskInfo call-path already set resources before the executor could finish launching.
- Adam B
On March 13, 2014, 7:42 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 13, 2014, 7:42 p.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c1a3e0f
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp 6abb95d
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 18, 2014, 9:23 a.m., Ian Downes wrote:
> > Some minor points for consideration.
Thanks for the review Ian! The executor->info change became a bit more substantial change. Mind taking a second look?
> On March 18, 2014, 9:23 a.m., Ian Downes wrote:
> > src/slave/slave.hpp, line 460
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line460>
> >
> > Could this not be Future<ExecutorInfo> and then remove the Future<bool> future below? This better reflects this variable - it's not available until launch is complete, rather than being optional.
I like it but this became a bigger change; try to take a look at the latest review :)
> On March 18, 2014, 9:23 a.m., Ian Downes wrote:
> > src/slave/slave.hpp, line 417
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line417>
> >
> > Do we really need both of these constructors for Executor?
It was to support recover(). I removed the old one and change the call-site in recover.
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37519
-----------------------------------------------------------
On March 19, 2014, 12:31 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 19, 2014, 12:31 p.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Ian Downes <ia...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37519
-----------------------------------------------------------
Ship it!
Some minor points for consideration.
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69069>
Do we really need both of these constructors for Executor?
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69070>
Executor::finalize doesn't seem to be a very appropriate name for part of the transition from LAUNCHING to REGISTERING?
Slave::finalize is for clean up when the slave is exiting.
What about launchCompleted() or something?
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69065>
Could this not be Future<ExecutorInfo> and then remove the Future<bool> future below? This better reflects this variable - it's not available until launch is complete, rather than being optional.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69066>
Is it worth pulling this removal out into a preceding review?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69067>
Move comments 2) and 3) to below the if (executor == NULL)?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69068>
see previous comment about using Future<ExecutorInfo>
- Ian Downes
On March 17, 2014, 5:37 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 17, 2014, 5:37 p.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated April 10, 2014, 12:19 p.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
Added RR dependencies.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
Diffs
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp 1ce41d7
src/slave/slave.hpp 08f6005
src/slave/slave.cpp cddb241
src/tests/containerizer.hpp a9f1531
src/tests/containerizer.cpp bfb9341
src/tests/slave_recovery_tests.cpp 72b6d42
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated April 10, 2014, 12:17 p.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
Rebased and ready for review.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp 1ce41d7
src/slave/slave.hpp 08f6005
src/slave/slave.cpp cddb241
src/tests/containerizer.hpp a9f1531
src/tests/containerizer.cpp bfb9341
src/tests/slave_recovery_tests.cpp 72b6d42
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated April 8, 2014, 2:19 p.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
Rebased.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/slave.hpp 15e23ce
src/slave/slave.cpp a356f5f
src/tests/containerizer.hpp a9f1531
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated April 3, 2014, 5:37 p.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
Rebased.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/slave.hpp 15e23ce
src/slave/slave.cpp a356f5f
src/tests/containerizer.hpp a9f1531
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Mesos ReviewBot <de...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review38989
-----------------------------------------------------------
Patch looks great!
Reviews applied: [19795, 18403]
All tests passed.
- Mesos ReviewBot
On March 28, 2014, 8:34 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 28, 2014, 8:34 p.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/slave.hpp 15e23ce
> src/slave/slave.cpp 6d901dc
> src/tests/containerizer.hpp a9f1531
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated March 28, 2014, 1:34 p.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
3rd and last split; launch by TaskInfo is now dependent on r19795.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description (updated)
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/slave.hpp 15e23ce
src/slave/slave.cpp 6d901dc
src/tests/containerizer.hpp a9f1531
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated March 21, 2014, 10:15 a.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
A container might be launching during reregistration and thus, the executor->info may not be ready and shouldn't cause the slave to fail (CHECK(executor->info.isReady()). doReliableReregistration has been split in two; the upper half does a collect on all executor->info's and second half sends reregistration message to master.
Split is coming up.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/http.cpp 594032d
src/slave/slave.hpp 01b80df
src/slave/slave.cpp d8d3e0f
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
src/tests/gc_tests.cpp ac547cf
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated March 20, 2014, 9:53 a.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
Working my way through Vinod's comments; will follow up with tests and patch split.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/http.cpp 594032d
src/slave/slave.hpp 01b80df
src/slave/slave.cpp d8d3e0f
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
src/tests/gc_tests.cpp ac547cf
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated March 19, 2014, 7:46 p.m.)
Review request for mesos, Ian Downes and Vinod Kone.
Changes
-------
I'll shepherd this with @idownes -- Vinod.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/http.cpp 594032d
src/slave/slave.hpp 01b80df
src/slave/slave.cpp d8d3e0f
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 3576-3588
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line3576>
> >
> > So the checkpointing of executor info is now being done after it is launched. So if a slave restarts before finalize() gets called there is no way to recover this info and inform the master. This is probably ok if the master stays up because the state will be reconciled when the slave re-registers. If the master also fails over then all bets are off and no one knows about the lost task/executor. This is unfortunate but I guess no different than if the slave restarted when the task was launched. Lets add a test for this.
>
> Niklas Nielsen wrote:
> You bet - sounds like a great idea. I'll work on it.
>
> Niklas Nielsen wrote:
> So just to clarify (and to get some input on how the test would work): This would involve imitating a launch which doesn't get to return an executor info in time before a fail-over happens?
Moving this to r19795
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 1081-1083
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line1081>
> >
> > Why is this a CHECK? What guarantees a framework will not be removed?
>
> Niklas Nielsen wrote:
> CHECK Should indeed be dropped. I don't think it is much different from the entry to killTask(); should we just ignore in _killTask with a warning instead (like in killTask)?
>
> Niklas Nielsen wrote:
> Ping :)
Moving this to r19795
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
On April 8, 2014, 2:19 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated April 8, 2014, 2:19 p.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/slave.hpp 15e23ce
> src/slave/slave.cpp a356f5f
> src/tests/containerizer.hpp a9f1531
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 1081-1083
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line1081>
> >
> > Why is this a CHECK? What guarantees a framework will not be removed?
CHECK Should indeed be dropped. I don't think it is much different from the entry to killTask(); should we just ignore in _killTask with a warning instead (like in killTask)?
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
On March 21, 2014, 10:15 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 21, 2014, 10:15 a.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
> src/tests/gc_tests.cpp ac547cf
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.hpp, line 440
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line440>
> >
> > Why do we need this?
> >
> > Why not just set Executor::id appropriately in the constructor?
> >
>
> Niklas Nielsen wrote:
> Good point!
We need the id before we have an executor structure; created in Framework::launch() which is called in _runTask() and we already need it in runTask()
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 588
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line588>
> >
> > Why is this a CHECK? What guarantees that the executor info is set when we are here?
Actually, several executor infos might be in flight when a reregistration happens; we will need to split reregistration in two and do a collect().onAny() on them. How does that sound?
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
On March 20, 2014, 9:53 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 20, 2014, 9:53 a.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
> src/tests/gc_tests.cpp ac547cf
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 916
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line916>
> >
> > Lets just pass executorId to this method instead of using this.
>
> Niklas Nielsen wrote:
> Great point - thanks!
Fixed in https://reviews.apache.org/r/19795/ :)
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
On March 21, 2014, 10:15 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 21, 2014, 10:15 a.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
> src/tests/gc_tests.cpp ac547cf
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > Can we add some tests around the new refactor (e.g., race conditions mentioned in the review)? That would make us confident that we are not regressing here, because this is a significant change.
Hey Vinod - thanks a lot for looking at this!
But I think we just missed each other; I uploaded a new patch before you got to publish your review.
I will post a new patch based on your recent comments and ping you :)
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.hpp, line 207
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line207>
> >
> > Why the change in return type?
Changed in recent review.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.hpp, line 438
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line438>
> >
> > s/finalize/launched/ ?
> >
> > Also add a comment on what this method does.
Changed to launchCompleted() in new patch. Will add a comment, thanks! :)
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.hpp, line 447
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line447>
> >
> > There are several places where executor state is checked and an appropriate action is taken. You should update them all with this state. I am not convinced that adding a new state is useful (or more trouble than its worth) here considering we have a future that tells whether it is launching or not.
I am not opposed to strip that out again. I introduced it based on previous comments and on the fact, the executor need to be in a pre-registering state when the executor info is unknown. Otherwise, the launching state is kinda implicit (based on executor->info state).
I'll go ahead and take a stab at removing LAUNCHING.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.hpp, line 460
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line460>
> >
> > +1 to Ian's comment.
Changed in recent patch.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 2159
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line2159>
> >
> > Maybe we should call this executorLaunched?
Good point - will change in upcoming patch.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 871
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line871>
> >
> > Sending 'true' here seems a bit hacky.
Changed in recent review.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 916
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line916>
> >
> > Lets just pass executorId to this method instead of using this.
Great point - thanks!
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 3154
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line3154>
> >
> > Why not just
> >
> > executor->future = ... ?
Changed in recent patch.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 2342-2346
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line2342>
> >
> > Why are these CHECKs?
Paranoia I suppose :)
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 3576-3588
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line3576>
> >
> > So the checkpointing of executor info is now being done after it is launched. So if a slave restarts before finalize() gets called there is no way to recover this info and inform the master. This is probably ok if the master stays up because the state will be reconciled when the slave re-registers. If the master also fails over then all bets are off and no one knows about the lost task/executor. This is unfortunate but I guess no different than if the slave restarted when the task was launched. Lets add a test for this.
You bet - sounds like a great idea. I'll work on it.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 2206
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line2206>
> >
> > Is this only called here? If yes, lets not pull this out.
Sure can do.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 1546-1547
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line1546>
> >
> > ditto. Why is this a check?
Paranoia :)
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.hpp, line 440
> > <https://reviews.apache.org/r/18403/diff/5/?file=522998#file522998line440>
> >
> > Why do we need this?
> >
> > Why not just set Executor::id appropriately in the constructor?
> >
Good point!
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, line 785
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line785>
> >
> > This should be moved to __runTask() to ensure framework doesn't get removed before __runTask() gets called.
Ah - good catch. Thanks!
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 860-871
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line860>
> >
> > Why not just always do onAny(_runTask) irrespective of the state?
> >
> > More importantly the current way it is done could lead to running tasks out of order. For example, if the first task is defered due to a launch, and the future is set while a second task is in the master's queue then the second task will be launched before the first.
Good catch. Will change in upcoming patch.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 1055-1065
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line1055>
> >
> > ditto. always enqueue on onAny.
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
On March 19, 2014, 12:46 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 19, 2014, 12:46 p.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 1081-1083
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line1081>
> >
> > Why is this a CHECK? What guarantees a framework will not be removed?
>
> Niklas Nielsen wrote:
> CHECK Should indeed be dropped. I don't think it is much different from the entry to killTask(); should we just ignore in _killTask with a warning instead (like in killTask)?
Ping :)
> On March 19, 2014, 12:45 p.m., Vinod Kone wrote:
> > src/slave/slave.cpp, lines 3576-3588
> > <https://reviews.apache.org/r/18403/diff/5/?file=522999#file522999line3576>
> >
> > So the checkpointing of executor info is now being done after it is launched. So if a slave restarts before finalize() gets called there is no way to recover this info and inform the master. This is probably ok if the master stays up because the state will be reconciled when the slave re-registers. If the master also fails over then all bets are off and no one knows about the lost task/executor. This is unfortunate but I guess no different than if the slave restarted when the task was launched. Lets add a test for this.
>
> Niklas Nielsen wrote:
> You bet - sounds like a great idea. I'll work on it.
So just to clarify (and to get some input on how the test would work): This would involve imitating a launch which doesn't get to return an executor info in time before a fail-over happens?
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
On March 28, 2014, 1:34 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 28, 2014, 1:34 p.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/slave.hpp 15e23ce
> src/slave/slave.cpp 6d901dc
> src/tests/containerizer.hpp a9f1531
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Vinod Kone <vi...@gmail.com>.
> On March 19, 2014, 7:45 p.m., Vinod Kone wrote:
> > Can we add some tests around the new refactor (e.g., race conditions mentioned in the review)? That would make us confident that we are not regressing here, because this is a significant change.
>
> Niklas Nielsen wrote:
> Hey Vinod - thanks a lot for looking at this!
>
> But I think we just missed each other; I uploaded a new patch before you got to publish your review.
> I will post a new patch based on your recent comments and ping you :)
No worries. I'm looking forward to landing this patch as this makes it easy to work with external containerizers :)
Can you also try it split this into multiple reviews? Some I could think of
1) Name change for executorStarted to executorLaunched
2) Making ExecutorInfo a Future.
3) Moving executor launch inside the Containerizer.
- Vinod
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
On March 19, 2014, 7:46 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 19, 2014, 7:46 p.m.)
>
>
> Review request for mesos, Ian Downes and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Vinod Kone <vi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37753
-----------------------------------------------------------
Can we add some tests around the new refactor (e.g., race conditions mentioned in the review)? That would make us confident that we are not regressing here, because this is a significant change.
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69495>
Why the change in return type?
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69408>
s/finalize/launched/ ?
Also add a comment on what this method does.
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69403>
Why do we need this?
Why not just set Executor::id appropriately in the constructor?
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69451>
There are several places where executor state is checked and an appropriate action is taken. You should update them all with this state. I am not convinced that adding a new state is useful (or more trouble than its worth) here considering we have a future that tells whether it is launching or not.
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69405>
+1 to Ian's comment.
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment69406>
kill this.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69417>
Why is this a CHECK? What guarantees that the executor info is set when we are here?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69429>
This should be moved to __runTask() to ensure framework doesn't get removed before __runTask() gets called.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69423>
Why not just always do onAny(_runTask) irrespective of the state?
More importantly the current way it is done could lead to running tasks out of order. For example, if the first task is defered due to a launch, and the future is set while a second task is in the master's queue then the second task will be launched before the first.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69425>
Sending 'true' here seems a bit hacky.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69432>
What about the slave state checks similar to what we have in _runTask()?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69441>
Lets just pass executorId to this method instead of using this.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69442>
ditto. always enqueue on onAny.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69446>
Why is this a CHECK? What guarantees a framework will not be removed?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69447>
ditto. why is this a check?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69453>
Indentation.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69454>
ditto on onAny.
Also, how is this possible? An executor is still launching but it is registering? Do we want to enforce an order here?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69460>
You should add checks for slave states here.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69455>
ditto. Why is this a check?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69456>
Lets add a CHECK here :)
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69461>
Indentation.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69462>
ditto. enque on onAny.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69469>
Include the executor and framework ids in log messages like these. Here and everywhere else.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69463>
Check for slave states.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69496>
Maybe we should call this executorLaunched?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69471>
Is this only called here? If yes, lets not pull this out.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69472>
Add a CHECK or just use executorInfo.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69474>
Why are these CHECKs?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69479>
Why not just
executor->future = ... ?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment69485>
So the checkpointing of executor info is now being done after it is launched. So if a slave restarts before finalize() gets called there is no way to recover this info and inform the master. This is probably ok if the master stays up because the state will be reconciled when the slave re-registers. If the master also fails over then all bets are off and no one knows about the lost task/executor. This is unfortunate but I guess no different than if the slave restarted when the task was launched. Lets add a test for this.
- Vinod Kone
On March 19, 2014, 7:31 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 19, 2014, 7:31 p.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated March 19, 2014, 12:31 p.m.)
Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
Changes
-------
Addressed Ian's comments.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/http.cpp 594032d
src/slave/slave.hpp 01b80df
src/slave/slave.cpp d8d3e0f
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated March 17, 2014, 10:37 a.m.)
Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c819c97
src/slave/http.cpp 594032d
src/slave/slave.hpp 01b80df
src/slave/slave.cpp d8d3e0f
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated March 13, 2014, 7:42 p.m.)
Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
Changes
-------
Addressed most of Adams comments.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp c1a3e0f
src/slave/http.cpp 594032d
src/slave/slave.hpp 01b80df
src/slave/slave.cpp 6abb95d
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37072
-----------------------------------------------------------
@Ian, ping. Can you take a 2nd look at this RR?
- Niklas Nielsen
On Feb. 27, 2014, 10:07 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated Feb. 27, 2014, 10:07 a.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp 6d990cb
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp 4f5349b
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On March 13, 2014, 3:27 p.m., Adam B wrote:
> > src/slave/slave.cpp, lines 851-860
> > <https://reviews.apache.org/r/18403/diff/3/?file=506155#file506155line851>
> >
> > Duplicated from _runTask. (Assuming we need to check this again in case the framework transitioned to TERMINATING while waiting on future.) Should we factor this out into a reusable function?
Great idea - I'd like to do that in a subsequent review though. I think it would be done across for most checks in slave.cpp. How does that sound?
> On March 13, 2014, 3:27 p.m., Adam B wrote:
> > src/slave/slave.cpp, line 862
> > <https://reviews.apache.org/r/18403/diff/3/?file=506155#file506155line862>
> >
> > This block is also largely duplicated from _runTask, but with different error strings. Factor it out? Same question for the rest of the duplicated code in your new lambdas.
Same here.
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37090
-----------------------------------------------------------
On March 17, 2014, 10:37 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 17, 2014, 10:37 a.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c819c97
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp d8d3e0f
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Adam B <ad...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review37090
-----------------------------------------------------------
Looking good. The issues I'm really concerned about are returning false in Slave::executorStarted and initializing Executor::resources.
I leave the rest up to Ian & Co.
src/slave/containerizer/mesos_containerizer.cpp
<https://reviews.apache.org/r/18403/#comment68461>
indentation
src/slave/containerizer/mesos_containerizer.cpp
<https://reviews.apache.org/r/18403/#comment68458>
Why not name this executorInfo? Then you wouldn't have to modify the references below.
src/slave/http.cpp
<https://reviews.apache.org/r/18403/#comment68388>
if (executor.info.isSome()) ?
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment68455>
Why remove the const? It's still set in the initializer list in both constructors.
src/slave/slave.hpp
<https://reviews.apache.org/r/18403/#comment68387>
Please comment on the purpose of this future. Maybe rename it 'launched'?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68401>
Will executor->info always exist if !commandExecutor? If not, you should check info.isSome().
Can't this also be changed to a CopyFrom, since executorInfo will be empty from start?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68402>
Can we kill this now? We're long past 0.15.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68408>
FYI, you won't need a separate frameworkId parameter after MESOS-905 lands, since it will be included in frameworkInfo.id.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68416>
Duplicated from _runTask. (Assuming we need to check this again in case the framework transitioned to TERMINATING while waiting on future.) Should we factor this out into a reusable function?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68418>
This block is also largely duplicated from _runTask, but with different error strings. Factor it out? Same question for the rest of the duplicated code in your new lambdas.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68466>
Put back the double-spacing.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68422>
This new comment is more relevant to the (executor->state == LAUNCHING) block below. Move it.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68424>
We already check getFramework in registerExecutor, so this failure would mean that the framework was removed/deactivated while waiting on the future?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68427>
Here, we're not even trying to register yet, we just waited for the executor to launch, and that's what failed. Will the future.failure() message indicate that? If not, perhaps this error message should be changed to "Could not register executor due to failure while launching: "
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68428>
Add LAUNCHING as an 'unexpected state'? Or can we just assume that it will never be in that state because we've successfully waited on executor->future?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68429>
Remove extra blank line.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68431>
Again, the failure was technically during launch, not (re)registration.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68432>
Remove extra blank line.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68433>
return false?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68434>
return false?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68439>
This happens when Slave still thinks that the executor is launching, but the container/executor reports back its termination? So then we wait for the slave's idea of the executor to settle out of the launching state, then handle its termination?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68443>
Why did you remove the CHECK(!executors.contains(executorId))? Is it now okay to launch an executor whose executorId already exists in Framework.executors?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68456>
What about initializing resources? Should this be copied from info during finalize()? The other constructor sets resources(_info.resources()).
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment68451>
I would expect an isFoobar() method to return a bool. If you're returning a Try<Nothing>, perhaps checkValidity()/testValidity() or more specifically checkExecutorIDs().
Where is this even used? I can't find any references.
- Adam B
On Feb. 27, 2014, 10:07 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated Feb. 27, 2014, 10:07 a.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp 6d990cb
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp 4f5349b
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated Feb. 27, 2014, 10:07 a.m.)
Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
Changes
-------
Addressed most of Ians comments; introduced a new executor state (LAUNCHING) and executor::future member to hang pending calls of. Further, killTask has been split into continuations.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp 6d990cb
src/slave/http.cpp 594032d
src/slave/slave.hpp 01b80df
src/slave/slave.cpp 4f5349b
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 1464
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line1464>
> >
> > ditto - what happens to Executor* if the future is ready?
Is this issue still relevant/out-standing?
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 1644
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line1644>
> >
> > ditto - Executor*
Same here.
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review35504
-----------------------------------------------------------
On March 13, 2014, 7:42 p.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated March 13, 2014, 7:42 p.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp c1a3e0f
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp 6abb95d
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > I think we need to work on this a little. It seems that making the launching state explicit and then cleaning up behavior (killTask) when in this state is necessary.
Thanks for the prompt review! :)
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/containerizer/mesos_containerizer.cpp, line 670
> > <https://reviews.apache.org/r/18403/diff/2/?file=503852#file503852line670>
> >
> > const ExecutorInfo& ?
Good point! Thanks :)
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 1021
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line1021>
> >
> > What about introducing a new executor state - Executor::LAUNCHING?
I like that idea - I will take that for a spin.
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 1432
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line1432>
> >
> > s/We might be in a situation where the executor is launching but not yet ready. The second half is scheduled until executor is ready, or called directly if executor is running./If the executor is still launching we'll defer registering until it is ready./?
Much better - thanks!
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 3505
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line3505>
> >
> > The determination of executor resources should be done by each containerizer implementation if they choose an executor.
Cool - scratched the comment.
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/containerizer/containerizer.hpp, line 125
> > <https://reviews.apache.org/r/18403/diff/2/?file=503849#file503849line125>
> >
> > Should this be in mesos_containerizer? I was thinking if the task didn't have task.executor() then the determination of the executor would be containerizer implementation dependent.
I wanted to make it available for other containerizers in case they wanted a default behavior. Moved it into mesos_containerizer.
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/containerizer/mesos_containerizer.cpp, line 402
> > <https://reviews.apache.org/r/18403/diff/2/?file=503852#file503852line402>
> >
> > Why is this a Future<>? Can you not just pass the ExecutorInfo to exec() and have it return?
Ah - that is a mistake. Thanks.
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 824
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line824>
> >
> > Could you swap this logic? i.e.,
> > if (contains) {
> > launch = framework->launchingExecutors[];
> > } else {
> > launch = framework->launch();
> > }
Sure :)
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 853
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line853>
> >
> > What happens to Executor* if the future is ready?
Not sure I follow; we can't do much with if the framework can't be found?
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 1006
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line1006>
> >
> > Previously executor == NULL was unexpected but now it seems weird to have NULL as a 'normal' value. Can we capture this is a better way?
Should be fixed with the new _killTask()
> On Feb. 26, 2014, 10:29 a.m., Ian Downes wrote:
> > src/slave/slave.cpp, line 1759
> > <https://reviews.apache.org/r/18403/diff/2/?file=503854#file503854line1759>
> >
> > okay :-p
With the new executor state, we should be able to clean up. So I scratched the comment.
- Niklas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review35504
-----------------------------------------------------------
On Feb. 27, 2014, 10:07 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated Feb. 27, 2014, 10:07 a.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp 6d990cb
> src/slave/http.cpp 594032d
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp 4f5349b
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Ian Downes <ia...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/#review35504
-----------------------------------------------------------
I think we need to work on this a little. It seems that making the launching state explicit and then cleaning up behavior (killTask) when in this state is necessary.
src/slave/containerizer/containerizer.hpp
<https://reviews.apache.org/r/18403/#comment66140>
Should this be in mesos_containerizer? I was thinking if the task didn't have task.executor() then the determination of the executor would be containerizer implementation dependent.
src/slave/containerizer/mesos_containerizer.cpp
<https://reviews.apache.org/r/18403/#comment66141>
Why is this a Future<>? Can you not just pass the ExecutorInfo to exec() and have it return?
src/slave/containerizer/mesos_containerizer.cpp
<https://reviews.apache.org/r/18403/#comment66143>
const ExecutorInfo& ?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66056>
Could you swap this logic? i.e.,
if (contains) {
launch = framework->launchingExecutors[];
} else {
launch = framework->launch();
}
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66057>
What happens to Executor* if the future is ready?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66058>
s/rebust/robust/
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66060>
Previously executor == NULL was unexpected but now it seems weird to have NULL as a 'normal' value. Can we capture this is a better way?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66062>
We shouldn't be returning TASK_LOST and claiming we cannot find the executor here if the executor is actually launching. If we haven't sent a launching executor the task then we should prevent that and act appropriately.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66063>
What about introducing a new executor state - Executor::LAUNCHING?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66065>
s/We might be in a situation where the executor is launching but not yet ready. The second half is scheduled until executor is ready, or called directly if executor is running./If the executor is still launching we'll defer registering until it is ready./?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66078>
ditto - what happens to Executor* if the future is ready?
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66134>
ditto - Executor*
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66135>
okay :-p
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66136>
perhaps not in this change, but this should done when the Future<ExecutorInfo> is ready rather than now.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66137>
ditto - should start timeout when the launch is ready.
src/slave/slave.cpp
<https://reviews.apache.org/r/18403/#comment66138>
The determination of executor resources should be done by each containerizer implementation if they choose an executor.
- Ian Downes
On Feb. 26, 2014, 12:04 a.m., Niklas Nielsen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18403/
> -----------------------------------------------------------
>
> (Updated Feb. 26, 2014, 12:04 a.m.)
>
>
> Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
>
>
> Bugs: MESOS-922
> https://issues.apache.org/jira/browse/MESOS-922
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
> Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
> This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
>
>
> Diffs
> -----
>
> src/slave/containerizer/containerizer.hpp d9ae326
> src/slave/containerizer/containerizer.cpp d0a1023
> src/slave/containerizer/mesos_containerizer.hpp ee1fd30
> src/slave/containerizer/mesos_containerizer.cpp 6d990cb
> src/slave/slave.hpp 01b80df
> src/slave/slave.cpp 4f5349b
> src/tests/containerizer.hpp 5686398
> src/tests/containerizer.cpp bfb9341
>
> Diff: https://reviews.apache.org/r/18403/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Niklas Nielsen
>
>
Re: Review Request 18403: Added support for launching tasks by TaskInfo.
Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18403/
-----------------------------------------------------------
(Updated Feb. 25, 2014, 4:04 p.m.)
Review request for mesos, Adam B, Benjamin Hindman, Ben Mahler, Ian Downes, Till Toenshoff, and Vinod Kone.
Changes
-------
Sorry Ian, here is a rebased patch. I will follow up with split versions of killTask, taskUpdate and possibly more. Saw cases where task updates came in from the executor process before it was registered/had a corresponding executor structure in the slave.
Bugs: MESOS-922
https://issues.apache.org/jira/browse/MESOS-922
Repository: mesos-git
Description
-------
This patch delegates the choice of executor to the containerizer by removing executorInfo dependencies up until Containerizer::launch().
Containerizer::launch() now returns a future to the executor info that is being run and the slave creates the corresponding executor structure when launch completes.
This means message handling from the running executor to the slave in the interim where the executor structure has not created, need to be enqueued until executor is ready. So far, registerExecutor() and reregisterExecutor() has been split into two continuations to deal with this issue.
Diffs (updated)
-----
src/slave/containerizer/containerizer.hpp d9ae326
src/slave/containerizer/containerizer.cpp d0a1023
src/slave/containerizer/mesos_containerizer.hpp ee1fd30
src/slave/containerizer/mesos_containerizer.cpp 6d990cb
src/slave/slave.hpp 01b80df
src/slave/slave.cpp 4f5349b
src/tests/containerizer.hpp 5686398
src/tests/containerizer.cpp bfb9341
Diff: https://reviews.apache.org/r/18403/diff/
Testing
-------
make check
Thanks,
Niklas Nielsen