[Serve] Fix proxy state crash on ActorUnschedulableError during RayService incremental upgrade - #65076
[Serve] Fix proxy state crash on ActorUnschedulableError during RayService incremental upgrade#65076ryanaoleary wants to merge 3 commits into
Conversation
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
There was a problem hiding this comment.
Code Review
This pull request improves the robustness of the proxy actor shutdown and health check logic in proxy_state.py by handling ActorUnschedulableError when a node dies during creation, and wrapping shutdown and kill operations in try-except blocks. The review feedback suggests avoiding redundant ray.kill calls when the actor is already shut down, and using the imported ActorUnschedulableError directly instead of its fully qualified name.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
jeffreywang88
left a comment
There was a problem hiding this comment.
great find! can we add some tests?
|
@ryanaoleary please rebase your PR after #64403 merged. your covers the kill case as well which is worth fixing. |
this is true? why should the new cluster restore its state from old clusters checkpoint? that sounds like a design flow in RayService incremental upgrade no? |
Description
Fixes an issue where the Ray Serve controller loop crashes with an uncaught
ActorUnschedulableErrorwhen attempting to shut down a proxy pinned to a dead or non-existant node. This PR wraps the shutdownray.get()call in atry...exceptblock, allowing the controller to gracefully clean up the dead proxy handle.When does this bug occur?
This race condition occurs when a proxy actor is created on a node that dies while the creation is still pending. It can be seen during RayService incremental upgrades when GCS Fault Tolerance with Redis is enabled:
PENDING_CREATION.alive_node_idsand callsshutdown()on the pending proxy handle.ray.get()throws anActorUnschedulableError, crashing the controller.Related issues
This issue was brought up in discussion in the KubeRay slack channel.
Additional information