-
Notifications
You must be signed in to change notification settings - Fork 6k
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] raise RequestCancelledError when request is cancelled during assignment #48496
Conversation
…ment Signed-off-by: Cindy Zhang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
python/ray/serve/handle.py
Outdated
except asyncio.CancelledError: | ||
raise RequestCancelledError from None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this take the request ID as an arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm yeah, it's optional though. let me see if we can get ahold of the request metadata here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added request ID, ptal!
Tested manually, example:
Traceback (most recent call last):
File "/Users/cindyz/workspace/test.py", line 44, in <module>
second_response.result()
File "/Users/cindyz/ray/python/ray/serve/handle.py", line 498, in result
replica_result = self._fetch_future_result_sync(timeout_s)
File "/Users/cindyz/ray/python/ray/serve/handle.py", line 334, in _fetch_future_result_sync
raise RequestCancelledError(self.request_id) from None
ray.serve.exceptions.RequestCancelledError: Request 83479b13-3676-46d3-9193-6be135718f2a was cancelled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe let's make it required so this is consistent
Signed-off-by: Cindy Zhang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Signed-off-by: Cindy Zhang <[email protected]>
…assignment (ray-project#48496) ## Why are these changes needed? Currently `ray.serve.exceptions.RequestCancelledError` is raised only when a request is cancelled during execution. We should also raise `RequestCancelledError` when a request is cancelled during assignment. --------- Signed-off-by: Cindy Zhang <[email protected]>
…assignment (ray-project#48496) ## Why are these changes needed? Currently `ray.serve.exceptions.RequestCancelledError` is raised only when a request is cancelled during execution. We should also raise `RequestCancelledError` when a request is cancelled during assignment. --------- Signed-off-by: Cindy Zhang <[email protected]>
…assignment (ray-project#48496) ## Why are these changes needed? Currently `ray.serve.exceptions.RequestCancelledError` is raised only when a request is cancelled during execution. We should also raise `RequestCancelledError` when a request is cancelled during assignment. --------- Signed-off-by: Cindy Zhang <[email protected]> Signed-off-by: mohitjain2504 <[email protected]>
Why are these changes needed?
Currently
ray.serve.exceptions.RequestCancelledError
is raised only when a request is cancelled during execution. We should also raiseRequestCancelledError
when a request is cancelled during assignment.