You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Joris Van Remoortere <jo...@gmail.com> on 2014/11/26 23:50:02 UTC

Review Request 28485: Provide a default bind() in Socket: any port localhost.

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

Review request for mesos, Benjamin Hindman and Niklas Nielsen.


Repository: mesos-git


Description
-------

This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).


Diffs
-----

  3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
  3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
  3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 

Diff: https://reviews.apache.org/r/28485/diff/


Testing
-------

make check


Thanks,

Joris Van Remoortere


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Dominic Hamon <dh...@twopensource.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/#review63386
-----------------------------------------------------------



3rdparty/libprocess/include/process/socket.hpp
<https://reviews.apache.org/r/28485/#comment105640>

    having an overload with a different inner Try might cause surprises at callsites.
    
    maybe return the bound node anyway to make things easier for users.



3rdparty/libprocess/src/process.cpp
<https://reviews.apache.org/r/28485/#comment105641>

    this can be simplified if you have one bind call that always takes a node.
    
        Try<Node> bind = __s__.bind(__node__);
        if (bind.isError()) {
          PLOG(FATAL) << "Failed to initialize: " << bind.error();
        }
        
        __node__ = bind.get();


- Dominic Hamon


On Nov. 27, 2014, 10:36 a.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated Nov. 27, 2014, 10:36 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
>   3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
>   3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Dominic Hamon <dh...@twopensource.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/#review63692
-----------------------------------------------------------

Ship it!


Ship It!

- Dominic Hamon


On Dec. 2, 2014, 6:09 p.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated Dec. 2, 2014, 6:09 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
>   3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
>   3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/#review63776
-----------------------------------------------------------

Ship it!


Ship It!

- Niklas Nielsen


On Dec. 2, 2014, 6:09 p.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated Dec. 2, 2014, 6:09 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
>   3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
>   3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/#review77255
-----------------------------------------------------------

Ship it!


Ship It!

- Jie Yu


On March 20, 2015, 6:24 p.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated March 20, 2015, 6:24 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Bugs: MESOS-2527
>     https://issues.apache.org/jira/browse/MESOS-2527
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/address.hpp 0f0a577bd1b8940f71fc486dcb1be7aa55d57ab2 
>   3rdparty/libprocess/include/process/socket.hpp 2c4258775bd90f91f1922a3cf2bb4ddf5c334881 
>   3rdparty/libprocess/src/process.cpp e7b029ba97e640c2102548c190ba62b30602f43d 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Joris Van Remoortere <jo...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/
-----------------------------------------------------------

(Updated March 20, 2015, 6:24 p.m.)


Review request for mesos, Benjamin Hindman and Niklas Nielsen.


Changes
-------

Removing static local and returning by value instead. RVO will optimize this out anyways.


Bugs: MESOS-2527
    https://issues.apache.org/jira/browse/MESOS-2527


Repository: mesos


Description
-------

This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).


Diffs (updated)
-----

  3rdparty/libprocess/include/process/address.hpp 0f0a577bd1b8940f71fc486dcb1be7aa55d57ab2 
  3rdparty/libprocess/include/process/socket.hpp 2c4258775bd90f91f1922a3cf2bb4ddf5c334881 
  3rdparty/libprocess/src/process.cpp e7b029ba97e640c2102548c190ba62b30602f43d 

Diff: https://reviews.apache.org/r/28485/diff/


Testing
-------

make check


Thanks,

Joris Van Remoortere


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Joris Van Remoortere <jo...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/
-----------------------------------------------------------

(Updated March 20, 2015, 5:42 p.m.)


Review request for mesos, Benjamin Hindman and Niklas Nielsen.


Bugs: MESOS-2527
    https://issues.apache.org/jira/browse/MESOS-2527


Repository: mesos


Description
-------

This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).


Diffs
-----

  3rdparty/libprocess/include/process/address.hpp 0f0a577bd1b8940f71fc486dcb1be7aa55d57ab2 
  3rdparty/libprocess/include/process/socket.hpp 2c4258775bd90f91f1922a3cf2bb4ddf5c334881 
  3rdparty/libprocess/src/process.cpp e7b029ba97e640c2102548c190ba62b30602f43d 

Diff: https://reviews.apache.org/r/28485/diff/


Testing
-------

make check


Thanks,

Joris Van Remoortere


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Joris Van Remoortere <jo...@gmail.com>.

> On March 19, 2015, 10:27 p.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/address.hpp, lines 34-38
> > <https://reviews.apache.org/r/28485/diff/4/?file=900318#file900318line34>
> >
> >     Just curious, what's the IPv6 story here? Do you need a LOCALHOST_ANY_V6() in the future?

from what I understand: IPv4 vs IPv6 will be abstracted away from Address (into IP). Depending on if this is environment variable based or not, we may or may not need a second function.


- Joris


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


On March 20, 2015, 6:24 p.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated March 20, 2015, 6:24 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Bugs: MESOS-2527
>     https://issues.apache.org/jira/browse/MESOS-2527
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/address.hpp 0f0a577bd1b8940f71fc486dcb1be7aa55d57ab2 
>   3rdparty/libprocess/include/process/socket.hpp 2c4258775bd90f91f1922a3cf2bb4ddf5c334881 
>   3rdparty/libprocess/src/process.cpp e7b029ba97e640c2102548c190ba62b30602f43d 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/#review77122
-----------------------------------------------------------



3rdparty/libprocess/include/process/address.hpp
<https://reviews.apache.org/r/28485/#comment125013>

    Just curious, what's the IPv6 story here? Do you need a LOCALHOST_ANY_V6() in the future?



3rdparty/libprocess/include/process/address.hpp
<https://reviews.apache.org/r/28485/#comment125014>

    Returning `const Address&` to a static variable is problematic during teardown in a multi-threaded enviornment because it'll be destructed while some thread might still be using it.
    
    So please return a copy or use a pointer for the static local variable.


- Jie Yu


On March 19, 2015, 7:23 p.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated March 19, 2015, 7:23 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/address.hpp 0f0a577bd1b8940f71fc486dcb1be7aa55d57ab2 
>   3rdparty/libprocess/include/process/socket.hpp 2c4258775bd90f91f1922a3cf2bb4ddf5c334881 
>   3rdparty/libprocess/src/process.cpp e7b029ba97e640c2102548c190ba62b30602f43d 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Joris Van Remoortere <jo...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/
-----------------------------------------------------------

(Updated March 19, 2015, 7:23 p.m.)


Review request for mesos, Benjamin Hindman and Niklas Nielsen.


Changes
-------

Rebased.


Repository: mesos


Description
-------

This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).


Diffs (updated)
-----

  3rdparty/libprocess/include/process/address.hpp 0f0a577bd1b8940f71fc486dcb1be7aa55d57ab2 
  3rdparty/libprocess/include/process/socket.hpp 2c4258775bd90f91f1922a3cf2bb4ddf5c334881 
  3rdparty/libprocess/src/process.cpp e7b029ba97e640c2102548c190ba62b30602f43d 

Diff: https://reviews.apache.org/r/28485/diff/


Testing
-------

make check


Thanks,

Joris Van Remoortere


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/#review66853
-----------------------------------------------------------


Sorry for stalling on this Joris. Would you mind rebasing so we can land this and the socket tests?

- Niklas Nielsen


On Dec. 2, 2014, 6:09 p.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated Dec. 2, 2014, 6:09 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
>   3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
>   3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Joris Van Remoortere <jo...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/
-----------------------------------------------------------

(Updated Dec. 3, 2014, 2:09 a.m.)


Review request for mesos, Benjamin Hindman and Niklas Nielsen.


Changes
-------

Revert back to bind returning the node.


Repository: mesos-git


Description
-------

This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).


Diffs (updated)
-----

  3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
  3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
  3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 

Diff: https://reviews.apache.org/r/28485/diff/


Testing
-------

make check


Thanks,

Joris Van Remoortere


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Joris Van Remoortere <jo...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/
-----------------------------------------------------------

(Updated Nov. 27, 2014, 6:36 p.m.)


Review request for mesos, Benjamin Hindman and Niklas Nielsen.


Changes
-------

Fix Style.
Use LOCALHOST_ANY() to implement Socket.bind(), and to set the default address for the libprocess server socket.


Repository: mesos-git


Description
-------

This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).


Diffs (updated)
-----

  3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
  3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
  3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 

Diff: https://reviews.apache.org/r/28485/diff/


Testing
-------

make check


Thanks,

Joris Van Remoortere


Re: Review Request 28485: Provide a default bind() in Socket: any port localhost.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28485/#review63178
-----------------------------------------------------------

Ship it!



3rdparty/libprocess/include/process/node.hpp
<https://reviews.apache.org/r/28485/#comment105355>

    s/Node &/Node& / and '{' on newline please.



3rdparty/libprocess/include/process/socket.hpp
<https://reviews.apache.org/r/28485/#comment105356>

    Let's be really explicit here too:
    
    return impl->bind(Node::LOCALHOST_ANY());



3rdparty/libprocess/src/process.cpp
<https://reviews.apache.org/r/28485/#comment105357>

    Let's change this to:
    
    __node__ = Node::LOCALHOST_ANY();


- Benjamin Hindman


On Nov. 26, 2014, 10:50 p.m., Joris Van Remoortere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28485/
> -----------------------------------------------------------
> 
> (Updated Nov. 26, 2014, 10:50 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Niklas Nielsen.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it clearer when we intend to bind on a specific ip:port (socket.bind(node)) and when we just want to bind to any local port (socket.bind()).
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/node.hpp 24132a5a9ff36a0fff3a25e7f7efce23777e3833 
>   3rdparty/libprocess/include/process/socket.hpp 3f3e01c7e9ecc52042c432212f697b69b3fde3b0 
>   3rdparty/libprocess/src/process.cpp 89e0e0cc15ab3fc8b1156906ef5f9b314c72c7e3 
> 
> Diff: https://reviews.apache.org/r/28485/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joris Van Remoortere
> 
>