You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Joseph Wu <jo...@mesosphere.io> on 2018/03/07 23:42:41 UTC

Re: Review Request 65692: Changed the signature of a DefaultExecutor kill method.

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



I suppose it's lucky that `Owned` is implemented with `shared_ptr`, otherwise, we'd be double-freeing most of these.


src/launcher/default_executor.cpp
Line 986 (original), 986 (patched)
<https://reviews.apache.org/r/65692/#comment278911>

    Here's another copy that should be made into a reference.



src/launcher/default_executor.cpp
Lines 1074-1076 (original), 1074-1076 (patched)
<https://reviews.apache.org/r/65692/#comment279075>

    As an alternative, you could change this to take a `Owned<Container>&` instead.


- Joseph Wu


On Feb. 16, 2018, 4:24 p.m., Gaston Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65692/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2018, 4:24 p.m.)
> 
> 
> Review request for mesos, Joseph Wu, Qian Zhang, and Vinod Kone.
> 
> 
> Bugs: MESOS-8530
>     https://issues.apache.org/jira/browse/MESOS-8530
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This method is being passed the container to be killed as
> `Owned<Container>`.
> 
> The container object is owned by the executor and stored in
> `LinkedHashMap<TaskID, Owner<Container>> containers`.
> 
> We should pass around raw pointers and not make copies of the stored
> `Owned` object, so this patch changes the signature of the `kill`
> method.
> 
> 
> Diffs
> -----
> 
>   src/launcher/default_executor.cpp 8720dada8bc6ca66f9e0fec6dc265eda3dcc7407 
> 
> 
> Diff: https://reviews.apache.org/r/65692/diff/1/
> 
> 
> Testing
> -------
> 
> `sudo bin/mesos-tests.sh` on GNU/Linux
> 
> 
> Thanks,
> 
> Gaston Kleiman
> 
>


Re: Review Request 65692: Changed the signature of a DefaultExecutor kill method.

Posted by Benjamin Bannier <be...@mesosphere.io>.

> On March 8, 2018, 12:42 a.m., Joseph Wu wrote:
> > src/launcher/default_executor.cpp
> > Line 986 (original), 986 (patched)
> > <https://reviews.apache.org/r/65692/diff/1/?file=1962286#file1962286line986>
> >
> >     Here's another copy that should be made into a reference.
> 
> Gaston Kleiman wrote:
>     This happens in many other places as well. My initial plan was to create a tech debt issue to audit the copies of `Owned` pointers, but I instead fixed this file here: https://reviews.apache.org/r/65962/

https://issues.apache.org/jira/browse/MESOS-5122


- Benjamin


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


On Feb. 17, 2018, 1:24 a.m., Gaston Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65692/
> -----------------------------------------------------------
> 
> (Updated Feb. 17, 2018, 1:24 a.m.)
> 
> 
> Review request for mesos, Joseph Wu, Qian Zhang, and Vinod Kone.
> 
> 
> Bugs: MESOS-8530
>     https://issues.apache.org/jira/browse/MESOS-8530
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This method is being passed the container to be killed as
> `Owned<Container>`.
> 
> The container object is owned by the executor and stored in
> `LinkedHashMap<TaskID, Owner<Container>> containers`.
> 
> We should pass around raw pointers and not make copies of the stored
> `Owned` object, so this patch changes the signature of the `kill`
> method.
> 
> 
> Diffs
> -----
> 
>   src/launcher/default_executor.cpp 906836f3b8e0af79d7c61f90fd8a95f193b26e84 
> 
> 
> Diff: https://reviews.apache.org/r/65692/diff/2/
> 
> 
> Testing
> -------
> 
> `sudo bin/mesos-tests.sh` on GNU/Linux
> 
> 
> Thanks,
> 
> Gaston Kleiman
> 
>


Re: Review Request 65692: Changed the signature of a DefaultExecutor kill method.

Posted by Gaston Kleiman <ga...@mesosphere.io>.

> On March 7, 2018, 3:42 p.m., Joseph Wu wrote:
> > src/launcher/default_executor.cpp
> > Line 986 (original), 986 (patched)
> > <https://reviews.apache.org/r/65692/diff/1/?file=1962286#file1962286line986>
> >
> >     Here's another copy that should be made into a reference.

This happens in many other places as well. My initial plan was to create a tech debt issue to audit the copies of `Owned` pointers, but I instead fixed this file here: https://reviews.apache.org/r/65962/


- Gaston


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


On Feb. 16, 2018, 4:24 p.m., Gaston Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65692/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2018, 4:24 p.m.)
> 
> 
> Review request for mesos, Joseph Wu, Qian Zhang, and Vinod Kone.
> 
> 
> Bugs: MESOS-8530
>     https://issues.apache.org/jira/browse/MESOS-8530
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This method is being passed the container to be killed as
> `Owned<Container>`.
> 
> The container object is owned by the executor and stored in
> `LinkedHashMap<TaskID, Owner<Container>> containers`.
> 
> We should pass around raw pointers and not make copies of the stored
> `Owned` object, so this patch changes the signature of the `kill`
> method.
> 
> 
> Diffs
> -----
> 
>   src/launcher/default_executor.cpp 906836f3b8e0af79d7c61f90fd8a95f193b26e84 
> 
> 
> Diff: https://reviews.apache.org/r/65692/diff/2/
> 
> 
> Testing
> -------
> 
> `sudo bin/mesos-tests.sh` on GNU/Linux
> 
> 
> Thanks,
> 
> Gaston Kleiman
> 
>