From 40588039febd93397a0a4751260d8326e6e6ab4d Mon Sep 17 00:00:00 2001 From: Jason Chen <892670992@qq.com> Date: Fri, 8 Dec 2023 11:22:32 +0800 Subject: [PATCH] Use local ipv6 address (#183) * use local ipv6 address Signed-off-by: NKcqx <892670992@qq.com> --------- Signed-off-by: NKcqx <892670992@qq.com> --- fed/cleanup.py | 2 +- fed/tests/test_listening_address.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fed/cleanup.py b/fed/cleanup.py index 6b974f8..811f21a 100644 --- a/fed/cleanup.py +++ b/fed/cleanup.py @@ -151,7 +151,7 @@ def _process_data_sending_task_return(self, message): try: res = ray.get(obj_ref) except Exception as e: - logger.warn(f'Failed to ??? send {obj_ref} to {dest_party}, error: {e},' + logger.warn(f'Failed to send {obj_ref} to {dest_party}, error: {e},' f'upstream_seq_id: {upstream_seq_id}, ' f'downstream_seq_id: {downstream_seq_id}.') if (isinstance(e, RayError)): diff --git a/fed/tests/test_listening_address.py b/fed/tests/test_listening_address.py index a6f2532..a278722 100644 --- a/fed/tests/test_listening_address.py +++ b/fed/tests/test_listening_address.py @@ -26,12 +26,12 @@ def _run(party): compatible_utils.init_ray(address='local') occupied_port = 11020 # NOTE(NKcqx): Firstly try to bind IPv6 because the grpc server will do so. - # Otherwise this UT will false because socket bind $occupied_port - # on IPv4 address while grpc server listendn Ipv6 address. + # Otherwise this UT will fail because socket bind $occupied_port + # on IPv4 address while grpc server listened on the Ipv6 address. try: s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) - # Pre-occuping the port - s.bind(("::", occupied_port)) + # Pre-occuping the port using local address + s.bind(("::1", occupied_port)) except OSError: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("127.0.0.1", occupied_port)) @@ -63,7 +63,6 @@ def test_listen_used_address(): if __name__ == "__main__": - # import sys + import sys - # sys.exit(pytest.main(["-sv", __file__])) - test_listen_used_address() + sys.exit(pytest.main(["-sv", __file__]))