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] NodeManager: code refactor and cleanup #45260

Merged
merged 4 commits into from
May 14, 2024

Conversation

hongchaodeng
Copy link
Member

Why are these changes needed?

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@hongchaodeng hongchaodeng changed the title [core] update comment for NodeManager [core] NodeManager: code refactor and cleanup May 11, 2024
@hongchaodeng hongchaodeng changed the title [core] NodeManager: code refactor and cleanup [core] NodeManager: update comments and includes May 11, 2024
@hongchaodeng hongchaodeng force-pushed the fix-nm-comment branch 3 times, most recently from 96cd408 to 69bb5bc Compare May 11, 2024 00:39
@hongchaodeng hongchaodeng changed the title [core] NodeManager: update comments and includes [core] NodeManager: code refactor and cleanup May 11, 2024
@hongchaodeng hongchaodeng force-pushed the fix-nm-comment branch 3 times, most recently from 59e85c7 to cab83a9 Compare May 11, 2024 01:00
Signed-off-by: hongchaodeng <hongchaodeng1@gmail.com>
@@ -196,7 +191,7 @@ class NodeManager : public rpc::NodeManagerServiceHandler,
/// \param object_ids The object ids to store error messages into.
/// \param job_id The optional job to push errors to if the writes fail.
void MarkObjectsAsFailed(const ErrorType &error_type,
const std::vector<rpc::ObjectReference> object_ids,
std::vector<rpc::ObjectReference> object_ids,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this to const &?

Also need to update in node_manager.cc as well

@@ -100,11 +100,13 @@ Raylet::Raylet(instrumented_io_context &main_service,

// Setting up autoscaler related fields from ENV
auto instance_id = std::getenv(kNodeCloudInstanceIdEnv);
self_node_info_.set_instance_id(instance_id ? instance_id : "");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the old way is actually preferred for checking whether pointer is nullptr: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es87-dont-add-redundant--or--to-conditions

Signed-off-by: hongchaodeng <hongchaodeng1@gmail.com>
Signed-off-by: hongchaodeng <hongchaodeng1@gmail.com>
Signed-off-by: hongchaodeng <hongchaodeng1@gmail.com>
@hongchaodeng
Copy link
Member Author

@jjyao Fixed

@jjyao jjyao merged commit 9472ae2 into ray-project:master May 14, 2024
5 checks passed
@hongchaodeng hongchaodeng deleted the fix-nm-comment branch May 14, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants