You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Meng Zhu <mz...@mesosphere.io> on 2018/03/19 18:43:10 UTC

Review Request 66143: Refactored agent task launch for better composition [2/2].

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

Review request for mesos, Chun-Hung Hsiao and Greg Mann.


Bugs: MESOS-8624
    https://issues.apache.org/jira/browse/MESOS-8624


Repository: mesos


Description
-------

This helps to encapsulate a task launch into a single
future which will come in handy when enforcing the task
launch order.

Affected tests are also updated.


Diffs
-----

  src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
  src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
  src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
  src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
  src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 


Diff: https://reviews.apache.org/r/66143/diff/1/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/#review200216
-----------------------------------------------------------




src/slave/slave.cpp
Line 2215 (original), 2220-2227 (patched)
<https://reviews.apache.org/r/66143/#comment280872>

    Not indented far enough.



src/slave/slave.cpp
Lines 2328-2335 (original), 2341-2371 (patched)
<https://reviews.apache.org/r/66143/#comment280873>

    Should be indented 2 more spaces.


- Greg Mann


On March 28, 2018, 1:07 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated March 28, 2018, 1:07 a.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp e76daabad0d2d68aa42d1da809d4a23459eaaacb 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp 0d7d9726ee39e4c588ea5eb8a54a73fbe1249353 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/5/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/
-----------------------------------------------------------

(Updated April 3, 2018, 10:38 a.m.)


Review request for mesos, Chun-Hung Hsiao and Greg Mann.


Bugs: MESOS-8617 and MESOS-8624
    https://issues.apache.org/jira/browse/MESOS-8617
    https://issues.apache.org/jira/browse/MESOS-8624


Repository: mesos


Description
-------

This helps to encapsulate a task launch into a single
future which will come in handy when enforcing the task
launch order.

Affected tests are also updated.


Diffs (updated)
-----

  src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
  src/slave/slave.cpp a4bd4ccd3fc59c3c0e462d9b480f5424b3e52d7a 
  src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
  src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
  src/tests/slave_tests.cpp 0d7d9726ee39e4c588ea5eb8a54a73fbe1249353 


Diff: https://reviews.apache.org/r/66143/diff/8/

Changes: https://reviews.apache.org/r/66143/diff/7-8/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/
-----------------------------------------------------------

(Updated April 2, 2018, 5:35 p.m.)


Review request for mesos, Chun-Hung Hsiao and Greg Mann.


Bugs: MESOS-8617 and MESOS-8624
    https://issues.apache.org/jira/browse/MESOS-8617
    https://issues.apache.org/jira/browse/MESOS-8624


Repository: mesos


Description
-------

This helps to encapsulate a task launch into a single
future which will come in handy when enforcing the task
launch order.

Affected tests are also updated.


Diffs (updated)
-----

  src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
  src/slave/slave.cpp a4bd4ccd3fc59c3c0e462d9b480f5424b3e52d7a 
  src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
  src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
  src/tests/slave_tests.cpp 0d7d9726ee39e4c588ea5eb8a54a73fbe1249353 


Diff: https://reviews.apache.org/r/66143/diff/7/

Changes: https://reviews.apache.org/r/66143/diff/6-7/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.

> On April 2, 2018, 4:21 p.m., Greg Mann wrote:
> > src/slave/slave.cpp
> > Lines 2396-2398 (patched)
> > <https://reviews.apache.org/r/66143/diff/6/?file=1991118#file1991118line2398>
> >
> >     Looks like we don't need this local variable?

You mean passing the whole error message directly to the function? I feel that hurts readability.


- Meng


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


On April 3, 2018, 10:38 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated April 3, 2018, 10:38 a.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp a4bd4ccd3fc59c3c0e462d9b480f5424b3e52d7a 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp 0d7d9726ee39e4c588ea5eb8a54a73fbe1249353 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/8/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/#review200325
-----------------------------------------------------------




src/slave/slave.cpp
Line 2332 (original), 2345 (patched)
<https://reviews.apache.org/r/66143/#comment281022>

    As in the previous review, ditto here regarding the naming of `framework_`. Let's switch to `_framework` for local consistency.



src/slave/slave.cpp
Lines 2354-2356 (patched)
<https://reviews.apache.org/r/66143/#comment281024>

    How about
    
    "Authorization failed for <task> of framework <frameworkID>: <error>"



src/slave/slave.cpp
Lines 2358 (patched)
<https://reviews.apache.org/r/66143/#comment281023>

    Ditto regarding the naming of `task_` here.



src/slave/slave.cpp
Lines 2384 (patched)
<https://reviews.apache.org/r/66143/#comment281025>

    Ditto regarding naming of `framework_`, here as well as `task_` and `framework_` below.



src/slave/slave.cpp
Lines 2386-2389 (patched)
<https://reviews.apache.org/r/66143/#comment281028>

    How about
    
    "Cannot handle authorization failure for <task> because the framework <frameworkID> does not exist"



src/slave/slave.cpp
Lines 2396-2398 (patched)
<https://reviews.apache.org/r/66143/#comment281029>

    Looks like we don't need this local variable?



src/slave/slave.cpp
Lines 2428-2430 (patched)
<https://reviews.apache.org/r/66143/#comment281030>

    This can be a `const string`. Also, let's be consistent and use the same indentation here that you use for other error strings above.


- Greg Mann


On April 2, 2018, 5:59 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated April 2, 2018, 5:59 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp a4bd4ccd3fc59c3c0e462d9b480f5424b3e52d7a 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp 0d7d9726ee39e4c588ea5eb8a54a73fbe1249353 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/6/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/
-----------------------------------------------------------

(Updated April 2, 2018, 10:59 a.m.)


Review request for mesos, Chun-Hung Hsiao and Greg Mann.


Bugs: MESOS-8617 and MESOS-8624
    https://issues.apache.org/jira/browse/MESOS-8617
    https://issues.apache.org/jira/browse/MESOS-8624


Repository: mesos


Description
-------

This helps to encapsulate a task launch into a single
future which will come in handy when enforcing the task
launch order.

Affected tests are also updated.


Diffs (updated)
-----

  src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
  src/slave/slave.cpp a4bd4ccd3fc59c3c0e462d9b480f5424b3e52d7a 
  src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
  src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
  src/tests/slave_tests.cpp 0d7d9726ee39e4c588ea5eb8a54a73fbe1249353 


Diff: https://reviews.apache.org/r/66143/diff/6/

Changes: https://reviews.apache.org/r/66143/diff/5-6/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/
-----------------------------------------------------------

(Updated March 27, 2018, 6:07 p.m.)


Review request for mesos, Chun-Hung Hsiao and Greg Mann.


Bugs: MESOS-8617 and MESOS-8624
    https://issues.apache.org/jira/browse/MESOS-8617
    https://issues.apache.org/jira/browse/MESOS-8624


Repository: mesos


Description
-------

This helps to encapsulate a task launch into a single
future which will come in handy when enforcing the task
launch order.

Affected tests are also updated.


Diffs (updated)
-----

  src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
  src/slave/slave.cpp e76daabad0d2d68aa42d1da809d4a23459eaaacb 
  src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
  src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
  src/tests/slave_tests.cpp 0d7d9726ee39e4c588ea5eb8a54a73fbe1249353 


Diff: https://reviews.apache.org/r/66143/diff/5/

Changes: https://reviews.apache.org/r/66143/diff/4-5/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/#review199859
-----------------------------------------------------------




src/slave/slave.cpp
Lines 2350 (patched)
<https://reviews.apache.org/r/66143/#comment280337>

    See my comment in the previous review regarding implicit capture of the framework pointer.


- Greg Mann


On March 22, 2018, 5:26 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated March 22, 2018, 5:26 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Greg Mann <gr...@mesosphere.io>.

> On March 23, 2018, 6 a.m., Greg Mann wrote:
> > src/slave/slave.cpp
> > Lines 2406-2407 (patched)
> > <https://reviews.apache.org/r/66143/diff/4/?file=1985519#file1985519line2406>
> >
> >     Let's use this opportunity to improve this error message. The precise reason for denied authorization is actually dependent on the authorizer - we give the entire framework info and task info to the authorizer, and it decides precisely what to use for authorization.
> >     
> >     Maybe something like:
> >     
> >     "Framework " + stringify(frameworkId) + " is not authorized to launch task " + stringify(task_)

This would also mean you could remove the other code above related to the 'user'.


- Greg


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


On March 22, 2018, 5:26 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated March 22, 2018, 5:26 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/#review199854
-----------------------------------------------------------


Fix it, then Ship it!





src/slave/slave.cpp
Lines 2215-2217 (original), 2216-2219 (patched)
<https://reviews.apache.org/r/66143/#comment280331>

    Why this change? Looks like this still fits on 3 lines.



src/slave/slave.cpp
Lines 2406 (patched)
<https://reviews.apache.org/r/66143/#comment280333>

    There is an extra single quote.



src/slave/slave.cpp
Lines 2406-2407 (patched)
<https://reviews.apache.org/r/66143/#comment280334>

    Let's use this opportunity to improve this error message. The precise reason for denied authorization is actually dependent on the authorizer - we give the entire framework info and task info to the authorizer, and it decides precisely what to use for authorization.
    
    Maybe something like:
    
    "Framework " + stringify(frameworkId) + " is not authorized to launch task " + stringify(task_)


- Greg Mann


On March 22, 2018, 5:26 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated March 22, 2018, 5:26 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/
-----------------------------------------------------------

(Updated March 22, 2018, 10:26 a.m.)


Review request for mesos, Chun-Hung Hsiao and Greg Mann.


Changes
-------

Thanks for the review! Patch updated.


Bugs: MESOS-8617 and MESOS-8624
    https://issues.apache.org/jira/browse/MESOS-8617
    https://issues.apache.org/jira/browse/MESOS-8624


Repository: mesos


Description
-------

This helps to encapsulate a task launch into a single
future which will come in handy when enforcing the task
launch order.

Affected tests are also updated.


Diffs (updated)
-----

  src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
  src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
  src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
  src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
  src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 


Diff: https://reviews.apache.org/r/66143/diff/4/

Changes: https://reviews.apache.org/r/66143/diff/3-4/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.

> On March 21, 2018, 4:22 p.m., Greg Mann wrote:
> > src/slave/slave.cpp
> > Lines 2386 (patched)
> > <https://reviews.apache.org/r/66143/diff/2/?file=1983714#file1983714line2386>
> >
> >     Let's make this variable a reference instead to avoid the copy:
> >     
> >     ```
> >     list<bool>& authorizations = future.get();
> >     ```

We are modifying the list below, can't avoid the copy.


- Meng


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


On March 22, 2018, 10:26 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated March 22, 2018, 10:26 a.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/#review199705
-----------------------------------------------------------




src/slave/slave.cpp
Line 2202 (original), 2203-2204 (patched)
<https://reviews.apache.org/r/66143/#comment280125>

    You can keep these on a single line:
    
    ```
    Future<Nothing> taskLaunch = collect(unschedules)
      .recover(defer(self(), onUnscheduleGCFailure))
    
      etc...
    ```



src/slave/slave.cpp
Lines 2348 (patched)
<https://reviews.apache.org/r/66143/#comment280114>

    Nit:
    s/_task/task_/
    
    Preceding underscores are only used to avoid shadowing in function parameters. Here and elsewhere.



src/slave/slave.cpp
Lines 2320-2321 (original), 2369-2371 (patched)
<https://reviews.apache.org/r/66143/#comment280116>

    Would recommend:
    
    ```
      return collect(authorizations)
        .recover(defer(self(),
        
        etc...
    ```



src/slave/slave.cpp
Lines 2325-2327 (original), 2375-2377 (patched)
<https://reviews.apache.org/r/66143/#comment280128>

    Let's do:
    
    ```
              string error =
                "Failed to authorize " + taskOrTaskGroup(task, taskGroup) +
                ": " + future.failure();
    ```



src/slave/slave.cpp
Lines 2386 (patched)
<https://reviews.apache.org/r/66143/#comment280118>

    Let's make this variable a reference instead to avoid the copy:
    
    ```
    list<bool>& authorizations = future.get();
    ```



src/slave/slave.cpp
Lines 2399-2400 (patched)
<https://reviews.apache.org/r/66143/#comment280119>

    Indentation:
    
    ```
                  } else if (executorInfo.has_command() &&
                             executorInfo.command().has_user()) {
    ```
    
    or
    
    ```
                  } else if (
                      executorInfo.has_command() &&
                      executorInfo.command().has_user()) {
    ```



src/slave/slave.cpp
Lines 2404-2406 (patched)
<https://reviews.apache.org/r/66143/#comment280120>

    Let's do:
    ```
                  string error =
                    "Task '" + stringify(_task.task_id()) + "'"
                    " is not authorized to launch as user '" + user + "'";
    ```



src/tests/slave_tests.cpp
Line 4137 (original), 4140 (patched)
<https://reviews.apache.org/r/66143/#comment280136>

    s/tie reaching the critical moment when to kill the task to `_run`./so that we can control when the task is killed./
    
    Here and below.


- Greg Mann


On March 20, 2018, 9:47 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66143/
> -----------------------------------------------------------
> 
> (Updated March 20, 2018, 9:47 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao and Greg Mann.
> 
> 
> Bugs: MESOS-8617 and MESOS-8624
>     https://issues.apache.org/jira/browse/MESOS-8617
>     https://issues.apache.org/jira/browse/MESOS-8624
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This helps to encapsulate a task launch into a single
> future which will come in handy when enforcing the task
> launch order.
> 
> Affected tests are also updated.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
>   src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
>   src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
>   src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
>   src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 
> 
> 
> Diff: https://reviews.apache.org/r/66143/diff/3/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 66143: Refactored agent task launch for better composition [2/2].

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66143/
-----------------------------------------------------------

(Updated March 20, 2018, 2:47 p.m.)


Review request for mesos, Chun-Hung Hsiao and Greg Mann.


Changes
-------

Patch updated to use `onReady` instead of `then` for invoking `__run` to avoid changing the return type of `__run`


Bugs: MESOS-8617 and MESOS-8624
    https://issues.apache.org/jira/browse/MESOS-8617
    https://issues.apache.org/jira/browse/MESOS-8624


Repository: mesos


Description
-------

This helps to encapsulate a task launch into a single
future which will come in handy when enforcing the task
launch order.

Affected tests are also updated.


Diffs (updated)
-----

  src/slave/slave.hpp 37f0361251524e63d02d251e8a03901812b8affb 
  src/slave/slave.cpp 915d4f1bbd642ca5d2587cfdd846262cb7e08788 
  src/tests/mock_slave.hpp 8ec2b65a75f774d970ef6507df8b0c02fda5f2fd 
  src/tests/mock_slave.cpp 8ec55b6aa84dd8b1c3743cbcdc246311585d0f63 
  src/tests/slave_tests.cpp f76500ebdb67f131a57a3b5aaae8c952d019e354 


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

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


Testing
-------

make check


Thanks,

Meng Zhu