> On July 18, 2016, 2:24 a.m., Qian Zhang wrote:
> > src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp, line 307
> > <https://reviews.apache.org/r/49819/diff/6/?file=1444539#file1444539line307>
> >
> > I think here you need to call `onAny()` rather than `then()`. You can
> > take a look at the following code as a reference:
> >
> > https://github.com/apache/mesos/blob/1.0.0-rc2/src/linux/cgroups.cpp#L1648:L1649
We could not use `onAny` here because it break the future chain. We only could
use `onAny` when return `void`.
For example, suppose we have these three methods:
```
Future<T> X::A()
{
return xxx.then(defer(self(), &Self::B));
}
Future<T> X::B();
{
return xxx.then(defer(self(), &Self::C));
}
Future<T> X::C()
{
return T(xxx);
}
```
If we change
```
Future<T> X::A()
{
return xxx.then(defer(self(), &Self::B));
}
```
to use `onAny`
```
Future<T> X::A()
{
return xxx.onAny(defer(self(), &Self::B)).then([]() -> T { return T(); });
}
```
then the `Future` return by `X::A()` would not wait for `X::C()` complete.
- haosdent
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49819/#review142528
-----------------------------------------------------------
On July 20, 2016, 6:37 p.m., haosdent huang wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49819/
> -----------------------------------------------------------
>
> (Updated July 20, 2016, 6:37 p.m.)
>
>
> Review request for mesos, Gilbert Song, Jie Yu, Qian Zhang, and Zhengju Sha.
>
>
> Bugs: MESOS-5041
> https://issues.apache.org/jira/browse/MESOS-5041
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Implemented `CgroupsIsolatorProcess::prepare`.
>
>
> Diffs
> -----
>
> src/slave/containerizer/mesos/isolators/cgroups/cgroups.hpp
> c57baec88437f68886702a40ec8a6a6458546119
> src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
> 4a9f55bf3b217405bf90943f27a976422877a99e
>
> Diff: https://reviews.apache.org/r/49819/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> haosdent huang
>
>