[pull] master from ray-project:master#4087
Merged
pull[bot] merged 1 commit intomiqdigital:masterfrom Apr 27, 2026
Merged
Conversation
## Description I ran into these docstrings while trying to drain a Ray worker via the GCS API for a specific operational case. The wording made me second-guess whether I was using the right API at all, so I traced the call sites to see who actually uses them. GcsClient.drain_node() in python/ray/includes/gcs_client.pxi says "This is only for testing." The same method is called from the ray drain-node CLI in python/ray/scripts/scripts.py and from autoscaler v2's ray_stopper in python/ray/autoscaler/v2/instance_manager/subscribers/ray_stopper.py, which uses it for idle and preemption-based termination. The ray drain-node CLI itself says "This is NOT a public API." It is hidden from ray --help, but it is the developer-facing entry point that talks to the same GCS API autoscaler v2 uses. Replace both docstrings with descriptions of what the function does, who calls it, and what each parameter and return value means. ## Related issues ## Additional information Call sites I confirmed for GcsClient.drain_node(): - python/ray/scripts/scripts.py: implements the `ray drain-node` CLI command. https://github.com/ray-project/ray/blob/master/python/ray/scripts/scripts.py#L2636-L2675 - python/ray/autoscaler/v2/instance_manager/subscribers/ray_stopper.py: invoked by autoscaler v2 with `DRAIN_NODE_REASON_IDLE_TERMINATION` and `DRAIN_NODE_REASON_PREEMPTION`. https://github.com/ray-project/ray/blob/master/python/ray/autoscaler/v2/instance_manager/subscribers/ray_stopper.py#L108 For the CLI, @cli.command(hidden=True) only suppresses it from the ray --help listing. It does not mark the command as test-only, so the original "NOT a public API" wording overstates its restriction. The new docstring keeps the stability caveat without implying the command is internal-only. Signed-off-by: Dongjun Na <kmu5544616@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )