-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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] Get node to connect for driver in global state accessor #16810
[Core] Get node to connect for driver in global state accessor #16810
Conversation
Can you provide an explanation about what this is and why we need it? |
@wuisawesome Sorry I didn't add a description because it was too late last night. Please see the PR description. |
boost::asio::ip::udp::resolver::iterator endpoints = resolver.resolve(query); | ||
boost::asio::ip::udp::endpoint ep = *endpoints; | ||
boost::asio::ip::udp::socket socket(netService); | ||
socket.connect(ep); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd better use a timeout here, and handle failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original Python code doesn't have a timeout either, and I already handled failure via try-catch.
Can you merge master and fix the conflicting files? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good for me. Someone need to review the GCS part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't add new function in GCS but only reuse existing get all nodes
, LGTM with just a tiny comments.
Probably you need to remove the new line added in the end of some files. :-)
} | ||
} | ||
|
||
if (!status.IsNotFound()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
|
Why are these changes needed?
When a driver starts, it needs to figure out the node manager port, the Raylet socket file path, and the Plasma store socket file path to be able to connect to the local Raylet. (A worker doesn't need this step because the information is included in worker command-line arguments.) This step is required by all language bindings. Currently, the logic is implemented in Python, which makes it hard to be reused by Java and C++ bindings.
In this PR, we move this logic to C++ code (global state accessor) to make it shared by all language bindings.
This PR also removes the mandatory and hardcoded
--node-manager-port 62665
parameter forray start --head
when users try the C++ API.Related issue number
#16735
Checks
scripts/format.sh
to lint the changes in this PR.