Repository navigation
[serve] don't stop retrying replicas when a deployment is scaling back up from zero - #51600
Merged
Merged
Conversation
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
akyang-anyscale
approved these changes
Mar 21, 2025
akyang-anyscale
left a comment
Contributor
There was a problem hiding this comment.
some nits, but lgtm
| self._replica_constructor_retry_counter += 1 | ||
| self._replica_constructor_error_msg = error_msg | ||
|
|
||
| # Update the deployment message only if replicas are failing during |
Contributor
There was a problem hiding this comment.
In the case the deployment has started a replica successfully, we still might want to show the "Retrying" message if a future replica is struggling to start up. We can just omit the # of times since it will retry indefinitely.
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
dhakshin32
pushed a commit
to dhakshin32/ray
that referenced
this pull request
Mar 27, 2025
…k up from zero (ray-project#51600) ## Why are these changes needed? Previously we added a new deployment status `DEPLOY_FAILED`, which a deployment transitions into if the replicas repeatedly fail to start after a new config update / new deployment. After a certain number of retries, the controller will stop retrying replicas for that deployment and it enters a terminal state. However that causes deployments whose replicas fail during autoscaling (from zero) to also stop retrying after the threshold. This PR fixes that. Summary of failure scenarios and how we now handle them: 1. A deployment is first deployed / re-deployed. If the number of replica failures exceed a threshold (`3 * target`), and not a single replica was able to start successfully, the deployment transitions to `DEPLOY_FAILED` and no more replicas are retried. This state is terminal, and user must redeploy. 2. An autoscaling deployment is deployed with `initial_replicas = 0`. A request is sent and replicas fail to start. Similarly if the number of replica failures exceed a threshold (`3 * target`), and not a single replica was able to start successfully, no more replicas are retried. The deployment transitions to `UNHEALTHY`. 3. An autoscaling deployment is deployed and replicas start successfully. It later scales down and tries to scale back up again, but there are a lot of replica failures. Here the deployment could transition to `UNHEALTHY` if there are enough replica failures, but replicas will _continue_ to retry. ## Related issue number closes ray-project#50710 --------- Signed-off-by: Cindy Zhang <[email protected]> Signed-off-by: Dhakshin Suriakannu <[email protected]>
srinathk10
pushed a commit
that referenced
this pull request
Mar 28, 2025
…k up from zero (#51600) ## Why are these changes needed? Previously we added a new deployment status `DEPLOY_FAILED`, which a deployment transitions into if the replicas repeatedly fail to start after a new config update / new deployment. After a certain number of retries, the controller will stop retrying replicas for that deployment and it enters a terminal state. However that causes deployments whose replicas fail during autoscaling (from zero) to also stop retrying after the threshold. This PR fixes that. Summary of failure scenarios and how we now handle them: 1. A deployment is first deployed / re-deployed. If the number of replica failures exceed a threshold (`3 * target`), and not a single replica was able to start successfully, the deployment transitions to `DEPLOY_FAILED` and no more replicas are retried. This state is terminal, and user must redeploy. 2. An autoscaling deployment is deployed with `initial_replicas = 0`. A request is sent and replicas fail to start. Similarly if the number of replica failures exceed a threshold (`3 * target`), and not a single replica was able to start successfully, no more replicas are retried. The deployment transitions to `UNHEALTHY`. 3. An autoscaling deployment is deployed and replicas start successfully. It later scales down and tries to scale back up again, but there are a lot of replica failures. Here the deployment could transition to `UNHEALTHY` if there are enough replica failures, but replicas will _continue_ to retry. ## Related issue number closes #50710 --------- Signed-off-by: Cindy Zhang <[email protected]> Signed-off-by: Srinath Krishnamachari <[email protected]>
qishengxhe
added a commit
to qishengxhe/ray
that referenced
this pull request
Sep 18, 2026
…update `is_available` was derived from `_terminally_failed()` alone, so once a rolling update hit the replica startup threshold the routers rejected every request (HTTP 503) although the old-version replicas that were not replaced yet were still RUNNING and in the broadcast running set. A deployment is now unavailable only when it is terminally failed *and* has no running replica, which keeps fresh deploys and scale-from-zero (ray-project#51600) unchanged. Tests: unit test on the broadcast payload after a failed rolling update (fails on master with is_available=False) and an integration test that keeps getting 200 from the surviving replica after DEPLOY_FAILED, for both a rebuild-class and a replica-restart-class update (fails on master with 503). Signed-off-by: Qisheng He <[email protected]>
qishengxhe
added a commit
to qishengxhe/ray
that referenced
this pull request
Sep 18, 2026
…update `is_available` was derived from `_terminally_failed()` alone, so once a rolling update hit the replica startup threshold the routers rejected every request (HTTP 503) although the old-version replicas that were not replaced yet were still RUNNING and in the broadcast running set. A deployment is now unavailable only when it is terminally failed *and* has no running replica, which keeps fresh deploys and scale-from-zero (ray-project#51600) unchanged. Tests: unit test on the broadcast payload after a failed rolling update (fails on master with is_available=False) and an integration test that keeps getting 200 from the surviving replica after DEPLOY_FAILED, for both a rebuild-class and a replica-restart-class update (fails on master with 503). Signed-off-by: Qisheng He <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Previously we added a new deployment status
DEPLOY_FAILED, which a deployment transitions into if the replicas repeatedly fail to start after a new config update / new deployment. After a certain number of retries, the controller will stop retrying replicas for that deployment and it enters a terminal state. However that causes deployments whose replicas fail during autoscaling (from zero) to also stop retrying after the threshold. This PR fixes that.Summary of failure scenarios and how we now handle them:
3 * target), and not a single replica was able to start successfully, the deployment transitions toDEPLOY_FAILEDand no more replicas are retried. This state is terminal, and user must redeploy.initial_replicas = 0. A request is sent and replicas fail to start. Similarly if the number of replica failures exceed a threshold (3 * target), and not a single replica was able to start successfully, no more replicas are retried. The deployment transitions toUNHEALTHY.UNHEALTHYif there are enough replica failures, but replicas will continue to retry.Related issue number
closes #50710