[core][observability] Improve observability when the core worker fails to read data from the Raylet socket #49163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
If a core worker process has already established a connection with the Raylet but the Raylet process subsequently exits, the core worker process will fail to read data from the socket. However, the error code returned is ENOENT, and users will see the message "No such file or directory" which is very confusing.
This PR improves observability, allowing users to identify that the I/O error is related to the socket.
For example, comment out import logging.handlers and run a random Ray program. The runtime environment agent process will fail to import logging.handlers, causing the Raylet process to exit because it shares fate with the runtime environment agent process. See #48958 (comment) for more details.
Related issue number
Checks
python3 -c "import ray; ray.init();"
Without this PR

With this PR

git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.