mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jie Yu" <yujie....@gmail.com>
Subject Re: Review Request 19602: Added utility functions to get IPv4 address of a given link device.
Date Tue, 25 Mar 2014 20:39:48 GMT


> On March 25, 2014, 5:31 p.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, line 326
> > <https://reviews.apache.org/r/19602/diff/1/?file=535060#file535060line326>
> >
> >     best practice is to store everything in host order and convert to network order
before packing them into a sockaddr_in.
> 
> Jie Yu wrote:
>     Yeah, but turns out that some of our stout functions (e.g., net::getHostname) expect
a uint32_t ip in network order. I just want it to be consistent so that we can hook those
interfaces together without worrying about converting between host and network order.
>     
>     Also, all the network isolator code expect network order addresses, so that can save
us a few conversions:)
> 
> Dominic Hamon wrote:
>     well the conversions should be trivial/free depending on the platform so i'm not
worried about that. It would be good to open up an issue to convert everything to expect host
order except when we're putting it over the wire.
> 
> Chi Zhang wrote:
>     Jie, how wide does this issues exist in stout or other parts of mesos? It might be
worth doing a house cleaning earlier than later if it is not already too much involved.
>     
>     network isolator doesn't really have a preference either, except using what is provided.
we just need to convert once for each address type.

Agreed with Dominic and Chi. I just scanned the code base and tried to make all our code base
consistent by storing ip in network order. However, I found that it's a non-trivial and non-portable
change. The main issue is that we store ip (in network order) in MasterInfo in ZooKeeper for
master detection. Ironically, we store all ports in host order!

So, I created a ticket to track this issue and plan to leave the code as it is:
https://issues.apache.org/jira/browse/MESOS-1145


- Jie


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


On March 25, 2014, 5:35 a.m., Jie Yu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19602/
> -----------------------------------------------------------
> 
> (Updated March 25, 2014, 5:35 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Chi Zhang, Ian Downes, Vinod Kone, and Cong
Wang.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> See summary. Will be used by the network isolator.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b3d46d6 
>   3rdparty/libprocess/3rdparty/stout/tests/net_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/19602/diff/
> 
> 
> Testing
> -------
> 
> make check on both OSX and Linux.
> 
> Also, manually verify the output with the output from ifconfig/ip addr show
> 
> 
> Thanks,
> 
> Jie Yu
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message