Skip to content

[pull] master from ray-project:master#4087

Merged
pull[bot] merged 1 commit intomiqdigital:masterfrom
ray-project:master
Apr 27, 2026
Merged

[pull] master from ray-project:master#4087
pull[bot] merged 1 commit intomiqdigital:masterfrom
ray-project:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 27, 2026

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 : )

## 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>
@pull pull Bot locked and limited conversation to collaborators Apr 27, 2026
@pull pull Bot added the ⤵️ pull label Apr 27, 2026
@pull pull Bot merged commit a157d4d into miqdigital:master Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant