mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avinash sridharan <avin...@mesosphere.io>
Subject Re: Review Request 55238: Use os::spawn in the CNI isolator.
Date Fri, 13 Jan 2017 19:15:27 GMT


> On Jan. 11, 2017, 10:11 a.m., Jiang Yan Xu wrote:
> > I feel if we keep `os::system()` in the codebase at all, this is one of the few
places it could actually be used... we could eliminate it so we can say there's no references
to `os::systems()` left today but it's a bit harsh to nit-picking on future use like this
in order to keep a "clean state"?
> 
> James Peach wrote:
>     I don't consider this harsh, just a minor, obvious improvement. While `system()`
is safe, `spawn()` is slightly better because it doesn't use the shell. We can't completely
eliminate `system()` because there are places that actually require the shell (eg. the port
mapping CNI plugin).
> 
> Jiang Yan Xu wrote:
>     OK I guess if the command is a static string and trivial enough *and some shell features
make it easier to write* then os::system still fine. For this case yes we can replace it.
> 
> Avinash sridharan wrote:
>     As long as `ifconfig` is guaranteed to be an elf binary and not a script I think
this should be ok. Looked at a few distributions and seems like that is the case.
> 
> Jiang Yan Xu wrote:
>     Why not a script? I tried to use os::spawn() with a script and it worked? Do you
mean shell builtin commands?

My bad, please ignore my comment. I didn't realize we are not using `posix_spawn` internally.
Should have verified the implementation.


- Avinash


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


On Jan. 12, 2017, 12:26 a.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55238/
> -----------------------------------------------------------
> 
> (Updated Jan. 12, 2017, 12:26 a.m.)
> 
> 
> Review request for mesos, Avinash sridharan and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-6862
>     https://issues.apache.org/jira/browse/MESOS-6862
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Use os::spawn in the CNI isolator.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/network/cni/cni.cpp ea91c71fdfac48a2fc1d31a0ee088a73244be367

> 
> Diff: https://reviews.apache.org/r/55238/diff/
> 
> 
> Testing
> -------
> 
> `sudo make check` (Fedora 25)
> 
> 
> Thanks,
> 
> James Peach
> 
>


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