-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[core] Only raise RayTaskError if user exception cannot be subclassed. #44379
Conversation
… the caller of `ray.get(obj_ref)` where caller can catch it. For ease of use, Ray makes a *dual* exception that inherits both `RayTaskError` and the user exception type, so it can be caught as either. Problem is, if the user exception is marked `@final`, we can't make such a dual exception. Notably, Pydantic v2 ValidationError is `@final`. This PR handles such case by issuing a warning and only raise the `RayTaskError`. The user exception can be accessed as `ray_task_error.cause`. Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[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.
Some style nits. Please let me know if you have questions. Correct any meanings I might have mangled. In particular, I don't know who "user" is. If it's the reader, just remove phrases like "user can"
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.
Code looks good. Let's address doc comments and we can merge it.
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Co-authored-by: angelinalg <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Test failed and is related. |
Co-authored-by: Jiajun Yao <[email protected]> Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
Signed-off-by: Ruiyang Wang <[email protected]>
When a Ray Task raises user exceptions, the exception is forwarded to the caller of
ray.get(obj_ref)
where caller can catch it. For ease of use, Ray makes a dual exception that inherits bothRayTaskError
and the user exception type, so it can be caught as either.Problem is, if the user exception is marked
@final
, we can't make such a dual exception. Notably, Pydantic v2 ValidationError is@final
. This PR handles such case by issuing a warning and only raise theRayTaskError
. The user exception can be accessed asray_task_error.cause
.Fixes #43401.