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][observability] Improve observability when the core worker fails to read data from the Raylet socket #49163

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions src/ray/common/client_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ Status ServerConnection::ReadBuffer(
bytes_remaining -= bytes_read;
if (error.value() == EINTR) {
continue;
} else if (error.value() == ENOENT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Two questions:

if (...) {
  continue;
}
if (...) {
  return ...;
}
// do something

Copy link
Member Author

Choose a reason for hiding this comment

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

ENOENT indicates no such entry, or not found, is NotFound a better interpretation?

image

If we use NotFound, the error message will appear as shown in the screenshot above. It feels a bit strange to me to see NotFound in the error message, as it indicates that the core worker process failed to connect to the raylet process.

Suggest to apply early return, which is suggested by clang-tidy: https://clang.llvm.org/extra/clang-tidy/checks/readability/else-after-return.html

Good to know!

return Status::IOError("Failed to read data from the socket: " + error.message());
} else if (error.value() != boost::system::errc::errc_t::success) {
return boost_to_ray_status(error);
}
Expand Down