Skip to content

Commit

Permalink
Use local ipv6 address (#183)
Browse files Browse the repository at this point in the history
* use local ipv6 address

Signed-off-by: NKcqx <[email protected]>

---------

Signed-off-by: NKcqx <[email protected]>
  • Loading branch information
NKcqx authored Dec 8, 2023
1 parent 54304c2 commit 4058803
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fed/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
13 changes: 6 additions & 7 deletions fed/tests/test_listening_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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__]))

0 comments on commit 4058803

Please sign in to comment.