Skip to content

[data] revert "continue grabbing task state until response is not None"#61066

Merged
aslonnie merged 1 commit intoray-project:releases/2.54.0from
anyscale:lonnie-260214-2540datafix
Feb 14, 2026
Merged

[data] revert "continue grabbing task state until response is not None"#61066
aslonnie merged 1 commit intoray-project:releases/2.54.0from
anyscale:lonnie-260214-2540datafix

Conversation

@aslonnie
Copy link
Copy Markdown
Collaborator

revert #60592, cherrypick #61064

@aslonnie aslonnie requested a review from a team as a code owner February 14, 2026 08:04
@aslonnie aslonnie added the go add ONLY when ready to merge, run all tests label Feb 14, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request reverts a previous change regarding hanging task detection logic. The logic to fetch a task's state is now performed eagerly when a task is first suspected of hanging, rather than lazily when an issue is about to be reported. This is a good change as it increases the likelihood of capturing the task state before it might be cleaned up. The associated cleanups, such as removing the task_id from HangingExecutionState and the now-unused get_latest_state_for_task function, are also appropriate.

I've found one minor issue with a type hint that should be corrected for better code quality and correctness.

Comment on lines +158 to +160
task_state: Union[
TaskState, List[TaskState]
] = ray.util.state.get_task(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The type hint for task_state is Union[TaskState, List[TaskState]], but ray.util.state.get_task can also return None. The type hint should be updated to Optional[Union[TaskState, List[TaskState]]] to accurately reflect the possible return values. This will improve code clarity and help static analysis tools.

Suggested change
task_state: Union[
TaskState, List[TaskState]
] = ray.util.state.get_task(
task_state: Optional[Union[
TaskState, List[TaskState]
]] = ray.util.state.get_task(

@aslonnie aslonnie merged commit 48bd1f8 into ray-project:releases/2.54.0 Feb 14, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant