Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serve] Propagate replica constructor error to deployment status message and print num retries left #48531

Merged

Conversation

akyang-anyscale
Copy link
Contributor

Why are these changes needed?

This change will surface the replica constructor error as soon as the replica constructor fails for whatever reason. The exception will be populated in the deployment status so that it's viewable from the ray dashboard. Additionally, the number of replica constructor retries left will also be updated in the error message. This will help users more quickly debug a deployment that is failing to start.

Related issue number

Closes #35604

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@akyang-anyscale akyang-anyscale added the go add ONLY when ready to merge, run all tests label Nov 4, 2024
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@akyang-anyscale akyang-anyscale marked this pull request as ready for review November 4, 2024 17:52
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@jcotant1 jcotant1 added the serve Ray Serve Related Issue label Nov 18, 2024
Copy link
Contributor

@zcin zcin left a comment

Choose a reason for hiding this comment

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

Overall LGTM, some questions!

@@ -1942,6 +1944,22 @@ def check_curr_status(self) -> Tuple[bool, bool]:
)
return False, any_replicas_recovering

if failed_to_start_count > self._prev_replica_constructor_retry_counter:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is _prev_replica_constructor_retry_counter necessary? Can we just always call update_message and change it to a no-op if the message is the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah you're right

python/ray/serve/tests/test_cli.py Show resolved Hide resolved
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Copy link
Contributor

@zcin zcin left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 1958 to 1959
if message != self._curr_status_info.message:
self._curr_status_info = self._curr_status_info.update_message(message)
Copy link
Contributor

Choose a reason for hiding this comment

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

might be easier to move the check into update_message method

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@zcin zcin enabled auto-merge (squash) November 21, 2024 02:29
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@zcin zcin merged commit d4c2c8d into ray-project:master Nov 22, 2024
5 checks passed
MortalHappiness pushed a commit to MortalHappiness/ray that referenced this pull request Nov 22, 2024
…age and print num retries left (ray-project#48531)

## Why are these changes needed?

This change will surface the replica constructor error as soon as the
replica constructor fails for whatever reason. The exception will be
populated in the deployment status so that it's viewable from the ray
dashboard. Additionally, the number of replica constructor retries left
will also be updated in the error message. This will help users more
quickly debug a deployment that is failing to start.

## Related issue number

<!-- For example: "Closes ray-project#1234" -->
Closes ray-project#35604

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@akyang-anyscale akyang-anyscale deleted the alexyang/serve-prop-replica-error branch November 25, 2024 17:49
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 serve Ray Serve Related Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[serve] Status message not updated after first replica constructor failure
3 participants