Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Custom socket name #9766

Merged
merged 5 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions python/ray/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ def _prepare_socket_file(self, socket_path, default_prefix):

This method helps to prepare a socket file.
1. Make the directory if the directory does not exist.
2. If the socket file exists, raise exception.
2. If the socket file exists, do nothing (this just means we aren't the
first worker on the node).

Args:
socket_path (string): the socket file to prepare.
Expand All @@ -488,9 +489,6 @@ def _prepare_socket_file(self, socket_path, default_prefix):
result = self._make_inc_temp(
prefix=default_prefix, directory_name=self._sockets_dir)
else:
if os.path.exists(socket_path):
raise RuntimeError(
"Socket file {} exists!".format(socket_path))
try_to_create_directory(os.path.dirname(socket_path))

# Check socket path length to make sure it's short enough
Expand Down
9 changes: 8 additions & 1 deletion python/ray/tests/test_advanced_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,14 @@ def test_socket_dir_not_existing(shutdown_only):
"tests", random_name)
temp_raylet_socket_name = os.path.join(temp_raylet_socket_dir,
"raylet_socket")
ray.init(num_cpus=1, raylet_socket_name=temp_raylet_socket_name)
ray.init(num_cpus=2, raylet_socket_name=temp_raylet_socket_name)

@ray.remote
def foo(x):
time.sleep(1)
return 2 * x

ray.get([foo.remote(i) for i in range(2)])


def test_raylet_is_robust_to_random_messages(ray_start_regular):
Expand Down