ThriftServer and get_client support for bind address and unix sockets
Summary: This diff fixes a bug in get_client flow where we accepted hostnames but didn't perform DNS resolution on them. That has been fixed by constructing the SocketAddress passing true to allowNameLookup. While writing a unittest for this I realized that we didn't support binding servers to localhost, so I allowed for doing so. Then I realized that it would be pretty simple to extend both get_client and ThriftServer to allow for unix sockets. Discovered that unittests waiting for server.get_address() could wait forever if there was some exception in server.serve(). So I propigated the exception to the get_address future if it is not .done(). I updated all callsites that could accept a hostname/ip to accept and ipaddress object. I updated path to accept a str or a Pathlike to support pathlib.Path. Reviewed By: ambv Differential Revision: D6911229 fbshipit-source-id: 2919a720da6bfa79db85fe55de10e8519ea39c82
Showing
Please register or sign in to comment