You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jie Yu <yu...@gmail.com> on 2017/12/01 00:07:11 UTC

Re: Review Request 64226: Added a `ns::supported` convenience API.

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




src/linux/ns.hpp
Lines 99 (patched)
<https://reviews.apache.org/r/64226/#comment270514>

    Can you add some reason why there is a kernel version check there?



src/linux/ns.cpp
Lines 134 (patched)
<https://reviews.apache.org/r/64226/#comment270513>

    indentation



src/linux/ns.cpp
Lines 136 (patched)
<https://reviews.apache.org/r/64226/#comment270515>

    can you short circuit here if anything from `nsTypes` is not part of `nstypes()` so that we don't even go to the following user namespace kernel version check if user namespace is not even show up in `nstypes()`
    
    Then, you don't even need the final `return supported == nsTypes;`



src/linux/ns.cpp
Lines 143 (patched)
<https://reviews.apache.org/r/64226/#comment270516>

    We don't print glog warning in helpers. What if we want to use this in launch helper?
    
    I'd prefer return `Try<bool>`


- Jie Yu


On Nov. 30, 2017, 10:03 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64226/
> -----------------------------------------------------------
> 
> (Updated Nov. 30, 2017, 10:03 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-8284
>     https://issues.apache.org/jira/browse/MESOS-8284
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a `ns::supported` convenience API which directly expresses the
> intent to probe whether a specific Linux namespace is supported on
> the running kernel and takes care of kernel versioning special cases.
> 
> 
> Diffs
> -----
> 
>   src/linux/ns.hpp e24d79a41eefcade343b2825b5a758d7d30a5f91 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
>   src/slave/containerizer/mesos/isolators/namespaces/ipc.cpp 2d89d598d24e3bcf01d652ce3f586c9e3ccfc20b 
>   src/slave/containerizer/mesos/isolators/namespaces/pid.cpp 4f8253b58018581e022eb1832b9b07703cbd318d 
>   src/slave/containerizer/mesos/isolators/network/port_mapping.cpp d60052e9e1ccdfaaac6c0db6acfdae325cea6a9e 
>   src/tests/containerizer/ns_tests.cpp 61adf8525b1df1a70d7fd9c747d2106630a7627d 
> 
> 
> Diff: https://reviews.apache.org/r/64226/diff/2/
> 
> 
> Testing
> -------
> 
> make check (Fedora 27)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 64226: Added a `ns::supported` convenience API.

Posted by James Peach <jp...@apache.org>.

> On Dec. 1, 2017, 12:07 a.m., Jie Yu wrote:
> > src/linux/ns.hpp
> > Lines 99 (patched)
> > <https://reviews.apache.org/r/64226/diff/2/?file=1904998#file1904998line99>
> >
> >     Can you add some reason why there is a kernel version check there?

The reason is in the implementation. I'll move it here.


> On Dec. 1, 2017, 12:07 a.m., Jie Yu wrote:
> > src/linux/ns.cpp
> > Lines 136 (patched)
> > <https://reviews.apache.org/r/64226/diff/2/?file=1904999#file1904999line136>
> >
> >     can you short circuit here if anything from `nsTypes` is not part of `nstypes()` so that we don't even go to the following user namespace kernel version check if user namespace is not even show up in `nstypes()`
> >     
> >     Then, you don't even need the final `return supported == nsTypes;`

Yup, will add. I'll retain `return supported == nsTypes` since we need that to check that all the requested types are supported.


> On Dec. 1, 2017, 12:07 a.m., Jie Yu wrote:
> > src/linux/ns.cpp
> > Lines 143 (patched)
> > <https://reviews.apache.org/r/64226/diff/2/?file=1904999#file1904999line143>
> >
> >     We don't print glog warning in helpers. What if we want to use this in launch helper?
> >     
> >     I'd prefer return `Try<bool>`

Yeh I added the log because it would be bizarrely weird if the `uname` failed. I can switch to `Try`.


- James


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


On Nov. 30, 2017, 10:03 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64226/
> -----------------------------------------------------------
> 
> (Updated Nov. 30, 2017, 10:03 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-8284
>     https://issues.apache.org/jira/browse/MESOS-8284
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added a `ns::supported` convenience API which directly expresses the
> intent to probe whether a specific Linux namespace is supported on
> the running kernel and takes care of kernel versioning special cases.
> 
> 
> Diffs
> -----
> 
>   src/linux/ns.hpp e24d79a41eefcade343b2825b5a758d7d30a5f91 
>   src/linux/ns.cpp 5e2df1ed56432c6c1bfa04a31dba7f9f547d6139 
>   src/slave/containerizer/mesos/isolators/namespaces/ipc.cpp 2d89d598d24e3bcf01d652ce3f586c9e3ccfc20b 
>   src/slave/containerizer/mesos/isolators/namespaces/pid.cpp 4f8253b58018581e022eb1832b9b07703cbd318d 
>   src/slave/containerizer/mesos/isolators/network/port_mapping.cpp d60052e9e1ccdfaaac6c0db6acfdae325cea6a9e 
>   src/tests/containerizer/ns_tests.cpp 61adf8525b1df1a70d7fd9c747d2106630a7627d 
> 
> 
> Diff: https://reviews.apache.org/r/64226/diff/2/
> 
> 
> Testing
> -------
> 
> make check (Fedora 27)
> 
> 
> Thanks,
> 
> James Peach
> 
>