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




src/slave/containerizer/mesos/isolators/network/ports.cpp
Lines 66-67 (patched)
<https://reviews.apache.org/r/60496/#comment259205>

    Usually when we define a `xxxProcess` class, we want it to do some works 
asynchronously, and we need an actor class (e.g., `NetworkPortsCollector`) for 
it. But in your case, it seems the only thing that 
`NetworkPortsCollectorProcess` does is to provide a helper method `collect()`. 
So I think we may not need this class, instead we could move the code of its 
`collect()` method to `NetworkPortsIsolatorProcess::check()`.



src/slave/containerizer/mesos/isolators/network/ports.cpp
Lines 350 (patched)
<https://reviews.apache.org/r/60496/#comment259203>

    Kill this empty line.



src/slave/containerizer/mesos/isolators/network/ports.cpp
Lines 362 (patched)
<https://reviews.apache.org/r/60496/#comment259204>

    I see you put the actual used resources (i.e. unallocated ports) here, 
however I am a bit confused if we should do it or should put the requested 
resources (allocated ports) here. In `PosixDiskIsolatorProcess::_collect()`, it 
seems we use the requested resource (disk quota), but in 
`MemorySubsystem::oomWaited()`, it seems we use the actual used resources.
    
    I think what you did here is correct, so we may need to update the code of 
`PosixDiskIsolatorProcess::_collect()`?


- Qian Zhang


On Aug. 18, 2017, 1:36 a.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60496/
> -----------------------------------------------------------
> 
> (Updated Aug. 18, 2017, 1:36 a.m.)
> 
> 
> Review request for mesos, Qian Zhang and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7675
>     https://issues.apache.org/jira/browse/MESOS-7675
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented ports resource restrictions in the network ports isolator.
> Periodically, scan for listening sockets and match them up to all
> the open sockets in the containers we are tracking in the network.
> Check any sockets we find against the ports resource and trigger a
> resource limitation if the port has not been allocated.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/network/ports.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/network/ports.cpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/60496/diff/11/
> 
> 
> Testing
> -------
> 
> make check (Fedora 26)
> 
> 
> Thanks,
> 
> James Peach
> 
>

Reply via email to