You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Greg Mann <gr...@mesosphere.io> on 2018/03/13 23:19:46 UTC

Re: Review Request 64618: Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.

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


Fix it, then Ship it!





src/master/master.cpp
Lines 5960 (patched)
<https://reviews.apache.org/r/64618/#comment279433>

    Can we move this to?
    
    `std::move(statusUuid.toBytes())`
    
    Looks like `toBytes()` returns a `std::string` and `set_value` has an overload for rvalue reference, so I think we can avoid a copy here if we move?


- Greg Mann


On Feb. 1, 2018, 11:52 p.m., Gaston Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64618/
> -----------------------------------------------------------
> 
> (Updated Feb. 1, 2018, 11:52 p.m.)
> 
> 
> Review request for mesos and Greg Mann.
> 
> 
> Bugs: MESOS-8184
>     https://issues.apache.org/jira/browse/MESOS-8184
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp cf03d8bf7df583c849a3b2a326d3772820181b0f 
>   src/master/master.hpp 8bf2c763dafdb7df55c46a56f2ff66f2a951d947 
>   src/master/master.cpp 223ebf29ac4dd1dea9080e4bef4b2d4d064d847f 
> 
> 
> Diff: https://reviews.apache.org/r/64618/diff/6/
> 
> 
> Testing
> -------
> 
> `make check` on GNU/Linux
> 
> 
> Thanks,
> 
> Gaston Kleiman
> 
>


Re: Review Request 64618: Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.

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

> On March 13, 2018, 4:19 p.m., Greg Mann wrote:
> > src/master/master.cpp
> > Lines 5960 (patched)
> > <https://reviews.apache.org/r/64618/diff/6/?file=1974232#file1974232line5961>
> >
> >     Can we move this to?
> >     
> >     `std::move(statusUuid.toBytes())`
> >     
> >     Looks like `toBytes()` returns a `std::string` and `set_value` has an overload for rvalue reference, so I think we can avoid a copy here if we move?
> 
> Gaston Kleiman wrote:
>     Since `statusUuid.toBytes()` here is an rvalue, I think that `set_value(std::string&&)` should be automatically used. I updated the patch anyway for the sake of explicitness/readability.

Well.. I just noticed that adding `std::move` breaks the build, so I reverted that part. Here's the error that it triggers:

```
master/master.cpp:6006:44: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
  message.mutable_status_uuid()->set_value(std::move(statusUuid.toBytes()));
                                           ^
../../src/master/master.cpp:6006:44: note: remove std::move call here
  message.mutable_status_uuid()->set_value(std::move(statusUuid.toBytes()));
                                           ^~~~~~~~~~                    ~
```


- Gaston


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


On March 14, 2018, 4:50 p.m., Gaston Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64618/
> -----------------------------------------------------------
> 
> (Updated March 14, 2018, 4:50 p.m.)
> 
> 
> Review request for mesos and Greg Mann.
> 
> 
> Bugs: MESOS-8184
>     https://issues.apache.org/jira/browse/MESOS-8184
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp cf03d8bf7df583c849a3b2a326d3772820181b0f 
>   src/master/master.hpp 8bf2c763dafdb7df55c46a56f2ff66f2a951d947 
>   src/master/master.cpp 223ebf29ac4dd1dea9080e4bef4b2d4d064d847f 
> 
> 
> Diff: https://reviews.apache.org/r/64618/diff/8/
> 
> 
> Testing
> -------
> 
> `make check` on GNU/Linux
> 
> 
> Thanks,
> 
> Gaston Kleiman
> 
>


Re: Review Request 64618: Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.

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

> On March 13, 2018, 4:19 p.m., Greg Mann wrote:
> > src/master/master.cpp
> > Lines 5960 (patched)
> > <https://reviews.apache.org/r/64618/diff/6/?file=1974232#file1974232line5961>
> >
> >     Can we move this to?
> >     
> >     `std::move(statusUuid.toBytes())`
> >     
> >     Looks like `toBytes()` returns a `std::string` and `set_value` has an overload for rvalue reference, so I think we can avoid a copy here if we move?

Since `statusUuid.toBytes()` here is an rvalue, I think that `set_value(std::string&&)` should be automatically used. I updated the patch anyway for the sake of explicitness/readability.


- Gaston


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


On March 14, 2018, 2:01 a.m., Gaston Kleiman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64618/
> -----------------------------------------------------------
> 
> (Updated March 14, 2018, 2:01 a.m.)
> 
> 
> Review request for mesos and Greg Mann.
> 
> 
> Bugs: MESOS-8184
>     https://issues.apache.org/jira/browse/MESOS-8184
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implemented the master's `ACKNOWLEDGE_OPERATION_STATUS` handler.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp cf03d8bf7df583c849a3b2a326d3772820181b0f 
>   src/master/master.hpp 8bf2c763dafdb7df55c46a56f2ff66f2a951d947 
>   src/master/master.cpp 223ebf29ac4dd1dea9080e4bef4b2d4d064d847f 
> 
> 
> Diff: https://reviews.apache.org/r/64618/diff/7/
> 
> 
> Testing
> -------
> 
> `make check` on GNU/Linux
> 
> 
> Thanks,
> 
> Gaston Kleiman
> 
>