Skip to content

Conversation

@ZacAttack
Copy link
Contributor

…0.0.0.0 server bindings (#59852)"

This reverts commit 60bb749.

Thank you for contributing to Ray! 🚀
Please review the Ray Contribution Guide before opening a pull request.

⚠️ Remove these instructions before submitting your PR.

💡 Tip: Mark as draft if you want early feedback, or ready for review when it's complete.

Description

Briefly describe what this PR accomplishes and why it's needed.

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

@ZacAttack ZacAttack added the go add ONLY when ready to merge, run all tests label Jan 9, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request appears to be reverting recently added IPv6 support, falling back to IPv4-only logic in many parts of the codebase. The changes span across Python and C++ files, replacing dynamic IP address resolution with hardcoded IPv4 addresses.

My review focuses on the correctness and consistency of this revert. While the Python changes seem correct, I've identified a recurring critical issue in the C++ changes. The logic to determine if a server should bind to localhost is incomplete, as it only checks for "127.0.0.1" and misses the "localhost" hostname case. This could lead to servers unintentionally binding to all interfaces.

Comment on lines +248 to +251
auto core_worker_server =
std::make_unique<rpc::GrpcServer>(WorkerTypeString(options.worker_type),
assigned_port,
options.node_ip_address == "127.0.0.1");
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This check for localhost is incomplete. It only checks for "127.0.0.1" and will fail if options.node_ip_address is "localhost". This would cause the gRPC server to incorrectly bind to all interfaces (0.0.0.0) instead of just localhost. To fix this, the check should also include "localhost".

Suggested change
auto core_worker_server =
std::make_unique<rpc::GrpcServer>(WorkerTypeString(options.worker_type),
assigned_port,
options.node_ip_address == "127.0.0.1");
auto core_worker_server =
std::make_unique<rpc::GrpcServer>(WorkerTypeString(options.worker_type),
assigned_port,
options.node_ip_address == "127.0.0.1" || options.node_ip_address == "localhost");

Comment on lines 69 to 73
rpc_server_(config.grpc_server_name,
config.grpc_server_port,
config.node_ip_address,
config.node_ip_address == "127.0.0.1",
config.grpc_server_thread_num,
/*keepalive_time_ms=*/RayConfig::instance().grpc_keepalive_time_ms()),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This check for localhost is incomplete. It only checks for "127.0.0.1" and will fail if config.node_ip_address is "localhost". This would cause the gRPC server to incorrectly bind to all interfaces (0.0.0.0) instead of just localhost. To fix this, the check should also include "localhost".

Suggested change
rpc_server_(config.grpc_server_name,
config.grpc_server_port,
config.node_ip_address,
config.node_ip_address == "127.0.0.1",
config.grpc_server_thread_num,
/*keepalive_time_ms=*/RayConfig::instance().grpc_keepalive_time_ms()),
rpc_server_(config.grpc_server_name,
config.grpc_server_port,
config.node_ip_address == "127.0.0.1" || config.node_ip_address == "localhost",
config.grpc_server_thread_num,
/*keepalive_time_ms=*/RayConfig::instance().grpc_keepalive_time_ms()),

Comment on lines 88 to 92
object_manager_server_("ObjectManager",
config_.object_manager_port,
config_.object_manager_address,
config_.object_manager_address == "127.0.0.1",
config_.rpc_service_threads_number),
client_call_manager_(main_service,
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This check for localhost is incomplete. It only checks for "127.0.0.1" and will fail if config_.object_manager_address is "localhost". This would cause the server to incorrectly bind to all interfaces (0.0.0.0) instead of just localhost. To fix this, the check should also include "localhost".

Suggested change
object_manager_server_("ObjectManager",
config_.object_manager_port,
config_.object_manager_address,
config_.object_manager_address == "127.0.0.1",
config_.rpc_service_threads_number),
client_call_manager_(main_service,
object_manager_server_("ObjectManager",
config_.object_manager_port,
config_.object_manager_address == "127.0.0.1" || config_.object_manager_address == "localhost",
config_.rpc_service_threads_number),

Comment on lines +217 to +219
node_manager_server_("NodeManager",
config.node_manager_port,
config.node_manager_address == "127.0.0.1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This check for localhost is incomplete. It only checks for "127.0.0.1" and will fail if config.node_manager_address is "localhost". This would cause the server to incorrectly bind to all interfaces (0.0.0.0) instead of just localhost. To fix this, the check should also include "localhost".

Suggested change
node_manager_server_("NodeManager",
config.node_manager_port,
config.node_manager_address == "127.0.0.1"),
node_manager_server_("NodeManager",
config.node_manager_port,
config.node_manager_address == "127.0.0.1" || config.node_manager_address == "localhost"),

@ZacAttack ZacAttack closed this Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

1 participant