-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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][usability] Disambiguate ObjectLostErrors for better understandability #18292
Changes from 10 commits
6cdcca8
50d761f
e8d5f21
8916315
d7d5b4c
8dd540d
2c06021
16b1af5
506d1fb
bd79ca6
ed861be
5a5fbf1
f493524
33e0187
1c0922c
af61dab
1b214da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,7 +171,7 @@ def __str__(self): | |
# due to the dependency failure. | ||
# Print out an user-friendly | ||
# message to explain that.. | ||
out.append(" Some of the input arguments for " | ||
out.append(" At least one of the input arguments for " | ||
"this task could not be computed:") | ||
if i + 1 < len(lines) and lines[i + 1].startswith(" "): | ||
# If the next line is indented with 2 space, | ||
|
@@ -279,8 +279,11 @@ def __str__(self): | |
"to list active objects in the cluster.") | ||
|
||
|
||
class ObjectLostError(RayError): | ||
"""Indicates that an object has been lost due to node failure. | ||
# TODO(XXX): Replace with ObjectLostError for backwards compatibility once all | ||
# Python tests pass. | ||
class ObjectUnreachableError(RayError): | ||
"""Generic error for objects that are unreachable due to node failure or | ||
system error. | ||
|
||
Attributes: | ||
object_ref_hex: Hex ID of the object. | ||
|
@@ -292,19 +295,103 @@ def __init__(self, object_ref_hex, call_site): | |
ray_constants.CALL_STACK_LINE_DELIMITER, "\n ") | ||
|
||
def __str__(self): | ||
msg = (f"Object {self.object_ref_hex} cannot be retrieved due to node " | ||
"failure or system error.") | ||
msg = f"Object {self.object_ref_hex} cannot be retrieved. " | ||
if self.call_site: | ||
msg += (f" The ObjectRef was created at: {self.call_site}") | ||
msg += (f"The ObjectRef was created at: {self.call_site}") | ||
else: | ||
msg += ( | ||
" To see information about where this ObjectRef was created " | ||
"To see information about where this ObjectRef was created " | ||
"in Python, set the environment variable " | ||
"RAY_record_ref_creation_sites=1 during `ray start` and " | ||
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. We also need to set this for driver. Why don't we write a doc and make a link instead? (I think it is confusing for users anyway when they just read it) 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. I added a doc, but left it out of the error message for now. I think it's best if we try to make the error messages standalone. |
||
"`ray.init()`.") | ||
return msg | ||
|
||
|
||
class ObjectLostError(ObjectUnreachableError): | ||
"""Indicates that the object is lost from distributed memory, due to | ||
node failure or system error. | ||
|
||
Attributes: | ||
object_ref_hex: Hex ID of the object. | ||
""" | ||
|
||
def __str__(self): | ||
return super().__str__() + "\n\n" + ( | ||
f"All copies of {self.object_ref_hex} are lost " | ||
"due to node failure.\n\n" | ||
"If you did not receive a message about a worker node " | ||
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. Just a thought, but I think we should write a debugging guideline doc and make a link here |
||
"dying, this is likely a system-level bug. " | ||
"Please file an issue on GitHub at " | ||
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. Prefer to remove "file an issue" logs. I think if I am a newbie user, I'd just think it is that Ray is unstable (since the message mentions the system level bug). |
||
"https://github.com/ray-project/ray/issues/new/choose.") | ||
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. Following https://spark.apache.org/error-message-guidelines.html, this can be rewritten as "All copies of {obj} have been lost due to node failure. Check cluster logs for more information about the failure." (be direct). |
||
|
||
|
||
class ObjectReleasedError(ObjectUnreachableError): | ||
"""Indicates that an object has been released while there was still a | ||
reference to it. | ||
|
||
Attributes: | ||
object_ref_hex: Hex ID of the object. | ||
""" | ||
|
||
def __str__(self): | ||
return super().__str__() + "\n\n" + ( | ||
f"Object {self.object_ref_hex} has already been released.\n\n" | ||
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. ReferenceCountingAssertionFailure: Attempted to retrieve an already-deleted object. This should not happen. |
||
"This is likely due to a corner case in the distributed " | ||
"reference counting protocol that can occur when a worker passes " | ||
"an ObjectRef, then exits before the ref count at the " | ||
"ObjectRef's owner can be updated. For example, suppose we " | ||
"call x_ref = foo.remote(...), pass [x_ref] to an actor A, and " | ||
"then actor A passes x_ref to actor B by calling " | ||
"B.bar.remote(x_ref). In this case, the driver may release x " | ||
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. Is this a P0 bug? 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. I think this is a long-living edge case we didn't handle. I remember I saw this from Stephanie's design doc? 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. Yes it's an existing corner case. |
||
"before B.bar executes, and B will receive this error.\n\n" | ||
"If your application does not match this scenario, then this is " | ||
"likely a system-level bug in the distributed ref counting " | ||
"protocol. Please file an issue on GitHub at " | ||
"https://github.com/ray-project/ray/issues/new/choose.") | ||
|
||
|
||
class OwnerDiedError(ObjectUnreachableError): | ||
"""Indicates that the owner of the object has died while there is still a | ||
reference to the object. | ||
|
||
Attributes: | ||
object_ref_hex: Hex ID of the object. | ||
""" | ||
|
||
def __str__(self): | ||
return super().__str__() + "\n\n" + ( | ||
f"Object {self.object_ref_hex} cannot be retrieved because " | ||
"the Python worker that first created the ObjectRef (via " | ||
"`.remote()` or `ray.put()`) has exited. " | ||
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.
|
||
"This can happen because of node failure or " | ||
"a system-level bug.\n\n" | ||
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. I think we should rather add a link to simple & easily explained ownership model doc instead? |
||
"If you did not receive a message about a worker node " | ||
"dying, this is likely a system-level bug. " | ||
"Please file an issue on GitHub at " | ||
"https://github.com/ray-project/ray/issues/new/choose.") | ||
|
||
|
||
class ObjectReconstructionFailedError(ObjectUnreachableError): | ||
"""Indicates that the owner of the object has died while there is still a | ||
reference to the object. | ||
|
||
Attributes: | ||
object_ref_hex: Hex ID of the object. | ||
""" | ||
|
||
def __str__(self): | ||
return super().__str__() + "\n\n" + ( | ||
f"Attempted lineage reconstruction to recover object " | ||
"{self.object_ref_hex}, but recovery failed. " | ||
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. The object could not be reconstructed since the max number of retries was exceeded. |
||
"This can happen if the task that creates this " | ||
"object, or an object that this object depends on, " | ||
"has already been executed up to its maximum number of " | ||
"retries (3 for normal tasks, 0 fo actor tasks).\n\n" | ||
"Lineage reconstruction is under active development. " | ||
"If you see this error, please file an issue at " | ||
"https://github.com/ray-project/ray/issues/new/choose.") | ||
|
||
|
||
class GetTimeoutError(RayError): | ||
"""Indicates that a call to the worker timed out.""" | ||
pass | ||
|
@@ -338,6 +425,9 @@ def __str__(self): | |
RayActorError, | ||
ObjectStoreFullError, | ||
ObjectLostError, | ||
ObjectReleasedError, | ||
ObjectReconstructionFailedError, | ||
OwnerDiedError, | ||
GetTimeoutError, | ||
AsyncioActorExit, | ||
RuntimeEnvSetupError, | ||
|
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.
I'll switch this back later, just putting this here for now so that I can see which Python tests would fail right now.