-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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] handle unserializable user exception #44878
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
55ca211
[core] handle unserializable user exception
hongchaodeng 4c1c0e8
Update doc/source/ray-core/fault_tolerance/tasks.rst
hongchaodeng 19edb34
Update python/ray/exceptions.py
hongchaodeng 27bbd7d
Update python/ray/exceptions.py
hongchaodeng 891887b
Update python/ray/exceptions.py
hongchaodeng 1622ee7
Update python/ray/tests/test_failure.py
hongchaodeng 71dcc79
Update python/ray/tests/test_failure.py
hongchaodeng 45c1a99
Update python/ray/tests/test_failure.py
hongchaodeng 42d8364
fix comment
hongchaodeng eb851a9
fix comment
hongchaodeng abcd62e
fix comment
hongchaodeng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,8 +130,20 @@ def __init__( | |
self.traceback_str = traceback_str | ||
self.actor_repr = actor_repr | ||
self._actor_id = actor_id | ||
# TODO(edoakes): should we handle non-serializable exception objects? | ||
self.cause = cause | ||
|
||
hongchaodeng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
try: | ||
pickle.dumps(cause) | ||
except (pickle.PicklingError, TypeError) as e: | ||
err_msg = ( | ||
"The original cause of RayTaskError" | ||
hongchaodeng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
f" ({self.cause.__class__}) is not serializable: {e}." | ||
hongchaodeng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
" Overwriting the cause to RayError." | ||
hongchaodeng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
logger.warning(err_msg) | ||
self.cause = RayError(err_msg) | ||
self.args = (function_name, traceback_str, self.cause, proctitle, pid, ip) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: we can just set self.args in the end of the constructor so we don't need to set it twice. basically move line 122 down to the end. |
||
|
||
assert traceback_str is not None | ||
|
||
def make_dual_exception_type(self) -> Type: | ||
|
This file contains 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
Oops, something went wrong.
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.
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.
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.
Yeah this is not my writings.
It's output from the program runs.
So let's not change it.
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.
Actually I just see you suggest changes on the code as well. I will update that and rerun the program to reflect it.