Conversation
simon-mo
left a comment
There was a problem hiding this comment.
the fix makes a lot of sense. i do wonder whether this work across public interface, private interface, and k8s based system
| def get_ip() -> str: | ||
| return socket.gethostbyname(socket.gethostname()) | ||
| s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||
| s.connect(("8.8.8.8", 80)) # Doesn't need to be reachable |
There was a problem hiding this comment.
what happen if it is not reachable? will it timeout/error?
There was a problem hiding this comment.
i tried some other non-reachable addresses and this still works
tested in k8s cluster and it fixes |
|
@simon-mo @yunfeng-scale I encountered the same issue ( I use |
Fixes #2407
socket.getaddrinfoonly returns IPv6 addresses