You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Qian Zhang <zh...@gmail.com> on 2018/05/10 12:52:37 UTC

Re: Review Request 66670: Ensured that `wait()` and `destroy()` return the same result.

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




src/slave/containerizer/composing.cpp
Line 599 (original), 599-602 (patched)
<https://reviews.apache.org/r/66670/#comment284825>

    Can you please let me know in which case we can reach here for a nested container? It seems we will only call `containerizer->destroy()` to destroy a nested containers in `Http::_launchContainer()` and `Http::launchNestedContainerSession()`, for both of them, the nested container should still be in `containers_` when they call `containerizer->destroy()`, but we can only reach here for the containers which are not in `containers_`.



src/slave/containerizer/composing.cpp
Line 621 (original), 629-632 (patched)
<https://reviews.apache.org/r/66670/#comment284813>

    Similarly, I am wondering if we can reach here for a nested container. If a nested container terminates but has not been removed from `containers_`, then it should be still in the `LAUNCHED` state, but we can only reach here for the containers in the `DESTROYING` state.


- Qian Zhang


On April 17, 2018, 11:23 p.m., Andrei Budnik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66670/
> -----------------------------------------------------------
> 
> (Updated April 17, 2018, 11:23 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Greg Mann, Jie Yu, and Qian Zhang.
> 
> 
> Bugs: MESOS-8713
>     https://issues.apache.org/jira/browse/MESOS-8713
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> We need to return the same `ContainerTermination` result for both
> `wait()` and `destroy()` for a terminated container. This patch
> ensures that for a terminated nested container `destroy()` returns
> the same result as for `wait()`.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/composing.cpp 186102c66d373dcd799cadd9fed7d1c8cb894971 
>   src/slave/containerizer/mesos/containerizer.cpp 01386ac3d36ec7a401b8d1be7834bc1f3fce55ef 
> 
> 
> Diff: https://reviews.apache.org/r/66670/diff/2/
> 
> 
> Testing
> -------
> 
> internal CI
> 
> 
> Thanks,
> 
> Andrei Budnik
> 
>


Re: Review Request 66670: Ensured that `wait()` and `destroy()` return the same result.

Posted by Qian Zhang <zh...@gmail.com>.

> On May 10, 2018, 8:52 p.m., Qian Zhang wrote:
> > src/slave/containerizer/composing.cpp
> > Line 621 (original), 629-632 (patched)
> > <https://reviews.apache.org/r/66670/diff/2/?file=2012422#file2012422line629>
> >
> >     Similarly, I am wondering if we can reach here for a nested container. If a nested container terminates but has not been removed from `containers_`, then it should be still in the `LAUNCHED` state, but we can only reach here for the containers in the `DESTROYING` state.
> 
> Andrei Budnik wrote:
>     Same as above.

I think here the key is the container is in the `DESTROYING` state (i.e., call `destroy` when a previous `destroy` is still going on) no matter it is nested container or not and terminated or not (it can be destroying but not terminated yet). So I think in this comment we should only mention case 1) but not case 2) which may cause confusion.


- Qian


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


On April 17, 2018, 11:23 p.m., Andrei Budnik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66670/
> -----------------------------------------------------------
> 
> (Updated April 17, 2018, 11:23 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Greg Mann, Jie Yu, and Qian Zhang.
> 
> 
> Bugs: MESOS-8713
>     https://issues.apache.org/jira/browse/MESOS-8713
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> We need to return the same `ContainerTermination` result for both
> `wait()` and `destroy()` for a terminated container. This patch
> ensures that for a terminated nested container `destroy()` returns
> the same result as for `wait()`.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/composing.cpp 1fb79f53b48154ecbd3b0165b6a8002c871e6dce 
>   src/slave/containerizer/mesos/containerizer.cpp eac1d16f2388385fec04ff8f013ce0ebf4e97f0f 
> 
> 
> Diff: https://reviews.apache.org/r/66670/diff/4/
> 
> 
> Testing
> -------
> 
> internal CI
> 
> 
> Thanks,
> 
> Andrei Budnik
> 
>


Re: Review Request 66670: Ensured that `wait()` and `destroy()` return the same result.

Posted by Andrei Budnik <ab...@mesosphere.com>.

> On May 10, 2018, 12:52 p.m., Qian Zhang wrote:
> > src/slave/containerizer/composing.cpp
> > Line 599 (original), 599-602 (patched)
> > <https://reviews.apache.org/r/66670/diff/2/?file=2012422#file2012422line599>
> >
> >     Can you please let me know in which case we can reach here for a nested container? It seems we will only call `containerizer->destroy()` to destroy a nested containers in `Http::_launchContainer()` and `Http::launchNestedContainerSession()`, for both of them, the nested container should still be in `containers_` when they call `containerizer->destroy()`, but we can only reach here for the containers which are not in `containers_`.

As we are unifying the semantics of the return value of `wait()` and `destroy()` methods to ensure that they always return the same result, it's necessarry to keep the property regardless current use-cases. This propery is a part of containerizer interface. I'm going to document it, see MESOS-8740. Also, this property is going to be used to implement MESOS-8829.


> On May 10, 2018, 12:52 p.m., Qian Zhang wrote:
> > src/slave/containerizer/composing.cpp
> > Line 621 (original), 629-632 (patched)
> > <https://reviews.apache.org/r/66670/diff/2/?file=2012422#file2012422line629>
> >
> >     Similarly, I am wondering if we can reach here for a nested container. If a nested container terminates but has not been removed from `containers_`, then it should be still in the `LAUNCHED` state, but we can only reach here for the containers in the `DESTROYING` state.

Same as above.


- Andrei


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


On April 17, 2018, 3:23 p.m., Andrei Budnik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66670/
> -----------------------------------------------------------
> 
> (Updated April 17, 2018, 3:23 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Greg Mann, Jie Yu, and Qian Zhang.
> 
> 
> Bugs: MESOS-8713
>     https://issues.apache.org/jira/browse/MESOS-8713
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> We need to return the same `ContainerTermination` result for both
> `wait()` and `destroy()` for a terminated container. This patch
> ensures that for a terminated nested container `destroy()` returns
> the same result as for `wait()`.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/composing.cpp 1fb79f53b48154ecbd3b0165b6a8002c871e6dce 
>   src/slave/containerizer/mesos/containerizer.cpp eac1d16f2388385fec04ff8f013ce0ebf4e97f0f 
> 
> 
> Diff: https://reviews.apache.org/r/66670/diff/4/
> 
> 
> Testing
> -------
> 
> internal CI
> 
> 
> Thanks,
> 
> Andrei Budnik
> 
>


Re: Review Request 66670: Ensured that `wait()` and `destroy()` return the same result.

Posted by Andrei Budnik <ab...@mesosphere.com>.

> On May 10, 2018, 12:52 p.m., Qian Zhang wrote:
> > src/slave/containerizer/composing.cpp
> > Line 621 (original), 629-632 (patched)
> > <https://reviews.apache.org/r/66670/diff/2/?file=2012422#file2012422line629>
> >
> >     Similarly, I am wondering if we can reach here for a nested container. If a nested container terminates but has not been removed from `containers_`, then it should be still in the `LAUNCHED` state, but we can only reach here for the containers in the `DESTROYING` state.
> 
> Andrei Budnik wrote:
>     Same as above.
> 
> Qian Zhang wrote:
>     I think here the key is the container is in the `DESTROYING` state (i.e., call `destroy` when a previous `destroy` is still going on) no matter it is nested container or not and terminated or not (it can be destroying but not terminated yet). So I think in this comment we should only mention case 1) but not case 2) which may cause confusion.

Both `containerizer->wait()` and the comment above it have been removed.


- Andrei


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


On April 17, 2018, 3:23 p.m., Andrei Budnik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66670/
> -----------------------------------------------------------
> 
> (Updated April 17, 2018, 3:23 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Greg Mann, Jie Yu, and Qian Zhang.
> 
> 
> Bugs: MESOS-8713
>     https://issues.apache.org/jira/browse/MESOS-8713
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> We need to return the same `ContainerTermination` result for both
> `wait()` and `destroy()` for a terminated container. This patch
> ensures that for a terminated nested container `destroy()` returns
> the same result as for `wait()`.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/composing.cpp 1fb79f53b48154ecbd3b0165b6a8002c871e6dce 
>   src/slave/containerizer/mesos/containerizer.cpp eac1d16f2388385fec04ff8f013ce0ebf4e97f0f 
> 
> 
> Diff: https://reviews.apache.org/r/66670/diff/5/
> 
> 
> Testing
> -------
> 
> internal CI
> 
> 
> Thanks,
> 
> Andrei Budnik
> 
>