-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RPC] Prefer IPv4 between IPv4 and IPv6 #7013
Conversation
And just a question to this PR. Maybe the better option is to set IPv4 type for all rpc connections? Or sometimes it is reasonable to have IPv6? |
python/tvm/exec/rpc_tracker.py
Outdated
@@ -33,7 +33,7 @@ def main(args): | |||
|
|||
if __name__ == "__main__": | |||
parser = argparse.ArgumentParser() | |||
parser.add_argument("--host", type=str, default="0.0.0.0", help="the hostname of the tracker") | |||
parser.add_argument("--host", type=str, default="localhost", help="the hostname of the tracker") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might prevent rpc tracker from being used other than local host
Thanks @echuraev It is indeed good to support IPv6, although the current change could make rpc tracker unavailable from other machines. The second best option is indeed to check and use 0.0.0.0 for now if the default one is ipv6 |
8c8aecc
to
396f5d6
Compare
I've updated the PR. Now we will prefer IPv4 type of IP protocol between IPv4 and IPv6. @tqchen please, take a look on it. |
This change fix problem with version of IP protocol on MacOS. Previous the `rpc_tracker` and `query_rpc_tracker` were not able connect to each other with default hostnames. The root cause was in method `socket.getaddrinfo`. In `rpc_tracker` the default hostname is "0.0.0.0" and `getaddrinfo` returns IPv4 type. In `query_rpc_tracker` the default hastname is "localhost" and `getaddrinfo` on MacOS returns IPv6 type. Note: on Linux both have IPv4 type. These tools worked by different protocols and this is why `query_rpc_tracker` wasn't able connect to `rpc_tracker`. Now we will prefer IPv4 type. And both `rpc_tracker` and `query_rpc_tracker` will use the same version of protocol.
396f5d6
to
89e670b
Compare
This change fix problem with version of IP protocol on MacOS. Previous the `rpc_tracker` and `query_rpc_tracker` were not able connect to each other with default hostnames. The root cause was in method `socket.getaddrinfo`. In `rpc_tracker` the default hostname is "0.0.0.0" and `getaddrinfo` returns IPv4 type. In `query_rpc_tracker` the default hastname is "localhost" and `getaddrinfo` on MacOS returns IPv6 type. Note: on Linux both have IPv4 type. These tools worked by different protocols and this is why `query_rpc_tracker` wasn't able connect to `rpc_tracker`. Now we will prefer IPv4 type. And both `rpc_tracker` and `query_rpc_tracker` will use the same version of protocol.
This change fix problem with version of IP protocol on MacOS. Previous the `rpc_tracker` and `query_rpc_tracker` were not able connect to each other with default hostnames. The root cause was in method `socket.getaddrinfo`. In `rpc_tracker` the default hostname is "0.0.0.0" and `getaddrinfo` returns IPv4 type. In `query_rpc_tracker` the default hastname is "localhost" and `getaddrinfo` on MacOS returns IPv6 type. Note: on Linux both have IPv4 type. These tools worked by different protocols and this is why `query_rpc_tracker` wasn't able connect to `rpc_tracker`. Now we will prefer IPv4 type. And both `rpc_tracker` and `query_rpc_tracker` will use the same version of protocol.
This change fix problem with version of IP protocol on MacOS. Previous the `rpc_tracker` and `query_rpc_tracker` were not able connect to each other with default hostnames. The root cause was in method `socket.getaddrinfo`. In `rpc_tracker` the default hostname is "0.0.0.0" and `getaddrinfo` returns IPv4 type. In `query_rpc_tracker` the default hastname is "localhost" and `getaddrinfo` on MacOS returns IPv6 type. Note: on Linux both have IPv4 type. These tools worked by different protocols and this is why `query_rpc_tracker` wasn't able connect to `rpc_tracker`. Now we will prefer IPv4 type. And both `rpc_tracker` and `query_rpc_tracker` will use the same version of protocol.
This change fix problem with version of IP protocol on MacOS.
Previous the
rpc_tracker
andquery_rpc_tracker
were not able connect toeach other with default hostnames.
The root cause was in method
socket.getaddrinfo
. Inrpc_tracker
thedefault hostname was "0.0.0.0" and
getaddrinfo
returned IPv4 type. Inquery_rpc_tracker
the default hastname is "localhost" andgetaddrinfo
on MacOS returns IPv6 type. Note: on Linux both have IPv4 type.
These tools worked by different protocols and this is why
query_rpc_tracker
wasn't able connect torpc_tracker
.Now the default hostnames are the same. So it works fine on MacOS.
@tqchen, @jroesch Could you please review it?