Skip to content

[train] Stop waiting for the placement group when a pinned node dies - #66765

Closed
justinvyu wants to merge 1 commit into
ray-project:masterfrom
justinvyu:justinvyu/train-pg-wait-dead-nodes
Closed

justinvyu wants to merge 1 commit into
ray-project:masterfrom
justinvyu:justinvyu/train-pg-wait-dead-nodes

Conversation

@justinvyu

Copy link
Copy Markdown
Contributor

Description

Train V2 pins workers to nodes in the AutoscalingCoordinator's reservation (#66002). The coordinator leaves out nodes that ray.nodes() reports dead, but the GCS can still report a just-removed node as alive for a short time. When several nodes go down together (spot preemption waves, an AZ failure, the autoscaler removing several nodes), the first death triggers a restart while the others still look alive, so the new pins can name a node that's already gone. That bundle can never be placed, and WorkerGroup waited the full RAY_TRAIN_WORKER_GROUP_START_TIMEOUT_S (60s) before retrying.

WorkerGroup now waits for the placement group in PINNED_NODE_CHECK_INTERVAL_S (1s) intervals when workers are pinned to node IDs. Between waits it checks ray.nodes() and stops as soon as a pinned node is no longer alive, raising the same retryable WorkerGroupStartupTimeoutError. Without node-id pins, it does a single full-timeout wait as before.

test_elastic_e2e removes every node at once and restarts right away, so it hits this window on purpose. Locally, that restart went from a 60s stall to giving up after about 1s ("Giving up on the placement group early…" in the controller log).

Known gap: when it stops early, the retried WorkerGroupStartupTimeoutError still says "timed out after 60.0 seconds". The info log just before it gives the real reason.

Related issues

Independent of the ResizeDecision pinning stack (linked in a comment) and can merge in either order. Together they address the test_elastic_e2e flake.

Testing

All passing locally (macOS, ray_dev_py311):

pytest python/ray/train/v2/tests/test_worker_group.py         # 42 passed
pytest python/ray/train/v2/tests/test_elastic_e2e.py          # passed (with the full change set)
pre-commit run --files <changed files>                        # clean

AI assistance (Claude Code) was used to write this change.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Justin Yu <[email protected]>
@justinvyu

Copy link
Copy Markdown
Contributor Author

Related stack that fixes the decision/pin mismatch half of the test_elastic_e2e flake: #66762 → #66763.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Oct 20, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no more activity in the 14 days
since being marked stale.

Please feel free to reopen or open a new pull request if you'd still like this to be addressed.

Again, you can always ask for help on our discussion forum or Ray's public slack channel.

Thanks again for your contribution!

@github-actions github-actions Bot closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale The issue is stale. It will be closed within 7 days unless there are further conversation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant