[RPC] Prefer IPv4 between IPv4 and IPv6 #7013
Merged
tqchen merged 1 commit intoapache:mainfrom Dec 3, 2020
Merged
Conversation
Contributor
Author
|
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? |
tqchen
approved these changes
Dec 2, 2020
tqchen
requested changes
Dec 2, 2020
| 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") |
Member
There was a problem hiding this comment.
This might prevent rpc tracker from being used other than local host
Member
|
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
Contributor
Author
|
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
tqchen
approved these changes
Dec 3, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 4, 2020
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.
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Dec 4, 2020
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.
electriclilies
pushed a commit
to electriclilies/tvm
that referenced
this pull request
Feb 18, 2021
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fix problem with version of IP protocol on MacOS.
Previous the
rpc_trackerandquery_rpc_trackerwere not able connect toeach other with default hostnames.
The root cause was in method
socket.getaddrinfo. Inrpc_trackerthedefault hostname was "0.0.0.0" and
getaddrinforeturned IPv4 type. Inquery_rpc_trackerthe default hastname is "localhost" andgetaddrinfoon MacOS returns IPv6 type. Note: on Linux both have IPv4 type.
These tools worked by different protocols and this is why
query_rpc_trackerwasn'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?