Repository navigation
[Serve] Gate replica/deployment creation during shutdown - #62761
abrarsheikh merged 4 commits into
Conversation
Signed-off-by: Vaishnavi Panchavati <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces guards to prevent new deployments, configuration updates, and replica scaling while the Ray Serve controller is shutting down. Key changes include adding checks for the _shutting_down flag in the controller and deployment state manager, along with corresponding unit tests. Review feedback highlights that the _shutting_down flag must be explicitly set to True within the shutdown method for these guards to be effective and recommends adding warning logs when requests are ignored to improve observability.
Signed-off-by: Vaishnavi Panchavati <[email protected]>
…te-new-replicas-clean Signed-off-by: Vaishnavi Panchavati <[email protected]>
7c41ffe to
2d78251
Compare
|
This pull request has been automatically marked as stale because it has not had 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. |
…te-new-replicas-clean
…#62761) ## Description During Serve shutdown, new deployments could still be created and replicas scaled up, leaking Ray actors. This PR adds `_shutting_down` early return guards on: - deploy(), autoscale(), set_target_num_replicas() in DeploymentStateManager - deploy_applications(), apply_config() in ServeController ### Tests - test_shutdown_blocks_deploy — deploy is a no-op after shutdown, no replicas created - test_shutdown_blocks_autoscale — autoscale is a no-op, target stays at 0 - test_shutdown_blocks_set_target_num_replicas — set_target_num_replicas is a no-op, no exception raised ## Related issues Fixes ray-project#62730 --------- Signed-off-by: Vaishnavi Panchavati <[email protected]>
…#62761) ## Description During Serve shutdown, new deployments could still be created and replicas scaled up, leaking Ray actors. This PR adds `_shutting_down` early return guards on: - deploy(), autoscale(), set_target_num_replicas() in DeploymentStateManager - deploy_applications(), apply_config() in ServeController ### Tests - test_shutdown_blocks_deploy — deploy is a no-op after shutdown, no replicas created - test_shutdown_blocks_autoscale — autoscale is a no-op, target stays at 0 - test_shutdown_blocks_set_target_num_replicas — set_target_num_replicas is a no-op, no exception raised ## Related issues Fixes ray-project#62730 --------- Signed-off-by: Vaishnavi Panchavati <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
Description
During Serve shutdown, new deployments could still be created and replicas scaled up, leaking Ray actors. This PR adds
_shutting_downearly return guards on:Tests
Related issues
Fixes #62730