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] Expose Redis getter to Python and use to retrieve session name #39194

Merged
merged 17 commits into from
Sep 5, 2023
12 changes: 8 additions & 4 deletions python/ray/includes/global_state_accessor.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ cdef extern from * namespace "ray::gcs" nogil:
instrumented_io_context io_service;

auto redis_client = std::make_shared<RedisClient>(options);
auto status = redis_client->Connect(io_service);

if(!status.ok()) {
RAY_LOG(ERROR) << "Failed to connect to redis: " << status.ToString();
try {
auto status = redis_client->Connect(io_service);
if(!status.ok()) {
RAY_LOG(ERROR) << "Failed to connect to redis: " << status.ToString();
return false;
}
} catch (std::exception& e) {
RAY_LOG(ERROR) << "Failed to connect to redis: " << e.what();
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion python/ray/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ py_test_module_list(
"test_multinode_failures_2.py",
"test_node_manager.py",
"test_object_assign_owner.py",
"test_placement_group.py",
"test_placement_group_2.py",
"test_placement_group_4.py",
"test_placement_group_failover.py",
Expand Down Expand Up @@ -319,6 +318,7 @@ py_test_module_list(
"test_reference_counting_2.py",
"test_exit_observability.py",
"test_usage_stats.py",
"test_placement_group.py",
"test_placement_group_3.py",
"test_placement_group_5.py",
"test_cancel.py",
Expand Down
2 changes: 0 additions & 2 deletions python/ray/tests/test_advanced_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@ def test_redis_wrong_password(monkeypatch, external_redis, call_ray_stop_only):
)

assert "RedisError: ERR AUTH <password> called" in p.stderr.decode()
assert "Please check /tmp/ray/session" in p.stderr.decode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the error message now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the authentication error

assert "RuntimeError: Failed to start GCS" in p.stderr.decode()


@pytest.mark.skipif(not enable_external_redis(), reason="Only valid in redis env")
Expand Down
2 changes: 1 addition & 1 deletion python/ray/tests/test_tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def check_all_log_file_exists():
assert sum(1 for filename in log_files if filename.startswith("worker")) == 4

socket_files = set(os.listdir(node.get_sockets_dir_path()))
assert socket_files == expected_socket_files
assert socket_files.issuperset(expected_socket_files)


def test_tempdir_privilege(shutdown_only):
Expand Down
Loading