You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Meng Zhu <mz...@mesosphere.io> on 2018/09/06 00:13:29 UTC

Review Request 68639: Renamed `Resources::resources` to `noMutationWithoutExclusiveOwnership`.

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

Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.


Repository: mesos


Description
-------

Due to the copy-on-write optimization (MESOS-6765), one needs to
check the `use_count` of `Resource_` before mutating. Currently,
there is no mechanism to enforce this. As a short-term mitigation
measure, we rename `resources` to `noMutationWithoutExclusiveOwnership`
to alert people about obtaining an exclusive ownership before mutating
the `Resource_` objects.


Diffs
-----

  include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
  include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
  src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
  src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 


Diff: https://reviews.apache.org/r/68639/diff/1/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 68639: Renamed `Resources::resources` to `noMutationWithoutExclusiveOwnership`.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68639/#review208400
-----------------------------------------------------------




include/mesos/v1/resources.hpp
Lines 695-696 (original), 704-705 (patched)
<https://reviews.apache.org/r/68639/#comment292296>

    This sounds like a commit message and less like documentation for the current state.
    
    Maybe just something like this?
    
        We name the `vector` field `noMutationWithoutExclusiveOwnership` ...



include/mesos/v1/resources.hpp
Line 703 (original), 714 (patched)
<https://reviews.apache.org/r/68639/#comment292299>

    I like how transparent this naming makes the need for future improvements, but it would be great if it would still transport that this is a container of `Resource_`.
    
    Something like `resources[NoMutationWithoutExclusiveOwnership|Unsafe|NotConcurrencySafe|...]` would make the resulting usages more readable.
    
    We could also accompany this with a name for the type users could use, e.g.,
    
        using Resources_Unsafe = std::shared_ptr<Resource_>;
        
    These could be used now in places we'd use cow wrappers once the `TODO` gets implemented.


- Benjamin Bannier


On Sept. 6, 2018, 2:13 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68639/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2018, 2:13 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Due to the copy-on-write optimization (MESOS-6765), one needs to
> check the `use_count` of `Resource_` before mutating. Currently,
> there is no mechanism to enforce this. As a short-term mitigation
> measure, we rename `resources` to `noMutationWithoutExclusiveOwnership`
> to alert people about obtaining an exclusive ownership before mutating
> the `Resource_` objects.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
>   include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
>   src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
>   src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 
> 
> 
> Diff: https://reviews.apache.org/r/68639/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 68639: Renamed `Resources::resources` to `noMutationWithoutExclusiveOwnership`.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68639/#review208393
-----------------------------------------------------------



PASS: Mesos patch 68639 was successfully built and tested.

Reviews applied: `['68490', '68639']`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2300/mesos-review-68639

- Mesos Reviewbot Windows


On Sept. 6, 2018, 12:13 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68639/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2018, 12:13 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Due to the copy-on-write optimization (MESOS-6765), one needs to
> check the `use_count` of `Resource_` before mutating. Currently,
> there is no mechanism to enforce this. As a short-term mitigation
> measure, we rename `resources` to `noMutationWithoutExclusiveOwnership`
> to alert people about obtaining an exclusive ownership before mutating
> the `Resource_` objects.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
>   include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
>   src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
>   src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 
> 
> 
> Diff: https://reviews.apache.org/r/68639/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 68639: Renamed `Resources::resources` vector and typedef its item type.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68639/#review208438
-----------------------------------------------------------



PASS: Mesos patch 68639 was successfully built and tested.

Reviews applied: `['68490', '68639']`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2307/mesos-review-68639

- Mesos Reviewbot Windows


On Sept. 7, 2018, 12:35 a.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68639/
> -----------------------------------------------------------
> 
> (Updated Sept. 7, 2018, 12:35 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Due to the copy-on-write optimization (MESOS-6765), one needs to
> check the `use_count` of `Resource_` before mutating. Currently,
> there is no mechanism to enforce this. As a short-term mitigation
> measure, we rename `resources` to
> `resourcesNoMutationWithoutExclusiveOwnership` and typedef its item
> type to `Resource_UnSafe`
> to alert people about obtaining an exclusive ownership before mutating
> the `Resource_` objects.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
>   include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
>   src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
>   src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 
> 
> 
> Diff: https://reviews.apache.org/r/68639/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 68639: Renamed `Resources::resources` vector and typedef its item type.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68639/#review208655
-----------------------------------------------------------



PASS: Mesos patch 68639 was successfully built and tested.

Reviews applied: `['68490', '68639']`

All the build artifacts available at: http://dcos-win.westus2.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/2340/mesos-review-68639

- Mesos Reviewbot Windows


On Sept. 14, 2018, 10:11 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68639/
> -----------------------------------------------------------
> 
> (Updated Sept. 14, 2018, 10:11 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Due to the copy-on-write optimization (MESOS-6765), one needs to
> check the `use_count` of `Resource_` before mutating. Currently,
> there is no mechanism to enforce this. As a short-term mitigation
> measure, we rename `resources` to
> `resourcesNoMutationWithoutExclusiveOwnership` and typedef its item
> type to `Resource_UnSafe`
> to alert people about obtaining an exclusive ownership before mutating
> the `Resource_` objects.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
>   include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
>   src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
>   src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 
> 
> 
> Diff: https://reviews.apache.org/r/68639/diff/3/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 68639: Renamed `Resources::resources` vector and typedef its item type.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68639/#review208811
-----------------------------------------------------------


Fix it, then Ship it!




Also, can you link this with a ticket for following up on the copy-on-write type change?


src/common/resources.cpp
Lines 1641-1659 (original), 1655-1677 (patched)
<https://reviews.apache.org/r/68639/#comment293015>

    Shouldn't these be `const Resource_Unsafe&`? Ditto for the other file.


- Benjamin Mahler


On Sept. 14, 2018, 10:11 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68639/
> -----------------------------------------------------------
> 
> (Updated Sept. 14, 2018, 10:11 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Due to the copy-on-write optimization (MESOS-6765), one needs to
> check the `use_count` of `Resource_` before mutating. Currently,
> there is no mechanism to enforce this. As a short-term mitigation
> measure, we rename `resources` to
> `resourcesNoMutationWithoutExclusiveOwnership` and typedef its item
> type to `Resource_UnSafe`
> to alert people about obtaining an exclusive ownership before mutating
> the `Resource_` objects.
> 
> 
> Diffs
> -----
> 
>   include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
>   include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
>   src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
>   src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 
> 
> 
> Diff: https://reviews.apache.org/r/68639/diff/3/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


Re: Review Request 68639: Renamed `Resources::resources` vector and typedef its item type.

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68639/
-----------------------------------------------------------

(Updated Sept. 14, 2018, 3:11 p.m.)


Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.


Repository: mesos


Description
-------

Due to the copy-on-write optimization (MESOS-6765), one needs to
check the `use_count` of `Resource_` before mutating. Currently,
there is no mechanism to enforce this. As a short-term mitigation
measure, we rename `resources` to
`resourcesNoMutationWithoutExclusiveOwnership` and typedef its item
type to `Resource_UnSafe`
to alert people about obtaining an exclusive ownership before mutating
the `Resource_` objects.


Diffs (updated)
-----

  include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
  include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
  src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
  src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 


Diff: https://reviews.apache.org/r/68639/diff/3/

Changes: https://reviews.apache.org/r/68639/diff/2-3/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 68639: Renamed `Resources::resources` vector and typedef its item type.

Posted by Meng Zhu <mz...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68639/
-----------------------------------------------------------

(Updated Sept. 6, 2018, 5:35 p.m.)


Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Gastón Kleiman.


Changes
-------

Addressed Benjamin's comment.


Summary (updated)
-----------------

Renamed `Resources::resources` vector and typedef its item type.


Repository: mesos


Description (updated)
-------

Due to the copy-on-write optimization (MESOS-6765), one needs to
check the `use_count` of `Resource_` before mutating. Currently,
there is no mechanism to enforce this. As a short-term mitigation
measure, we rename `resources` to
`resourcesNoMutationWithoutExclusiveOwnership` and typedef its item
type to `Resource_UnSafe`
to alert people about obtaining an exclusive ownership before mutating
the `Resource_` objects.


Diffs (updated)
-----

  include/mesos/resources.hpp 6f81b14f8bc090a144eeae8f15639c370366166d 
  include/mesos/v1/resources.hpp 09110530da16678abf6bf6b308906dd8ccc8180a 
  src/common/resources.cpp 3e63cdedb9261970dbeb9bb9f97eed65819f68a7 
  src/v1/resources.cpp 3683a331e0859cd6f2ad061db6ba67112ecfcb0d 


Diff: https://reviews.apache.org/r/68639/diff/2/

Changes: https://reviews.apache.org/r/68639/diff/1-2/


Testing
-------

make check


Thanks,

Meng Zhu