-
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
Make ray.get(timeout=0) to throw timeout error #30210
Conversation
@krfricke any idea who can review this? (I think the build failures are unrelated?) |
I think the main question is if this was intended API before or not. But yes, this will effectively be an API change and it will be hard to provide a graceful transition. |
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.
Looks good to me, thanks!
After internal discussion, it seems like this was a bug and we should fix it. cc @rickyyx to take a look from Ray core side |
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.
Should we also piggyback doc improvmeent?
ray/python/ray/_private/worker.py
Lines 2272 to 2285 in e1a8796
Args: | |
object_refs: Object ref of the object to get or a list of object refs | |
to get. | |
timeout (Optional[float]): The maximum amount of time in seconds to | |
wait before returning. | |
Returns: | |
A Python object or a list of Python objects. | |
Raises: | |
GetTimeoutError: A GetTimeoutError is raised if a timeout is set and | |
the get takes longer than timeout to return. | |
Exception: An exception is raised if the task that created the object | |
or that created one of the objects raised an exception. |
I feel the current documentation is not explicit in the behaviour of timeout=0 vs timeout=None, which could be better.
Also, does it make sense to change these as well now we have a proper timeout=0
behaviour:
https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/ray-project/ray%24+ray.get.*timeout%3D0.1&patternType=standard&sm=1
We shouldn't always raise an error? I think it should get the object if the object is ready. Is this covered? |
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.
request change on the comment ^
@vitrioil let me know if you want to take these changes, otherwise I'm happy to add them to this PR later this week |
An update on this - since this change will be breaking backward compatibility (there might be users who have code depends on this "buggy" behaviour), we will take a slower migration approach.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
|
This is still relevant. Can we make the stale bot less aggressive? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
|
Keep. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
|
Hi again! The issue will be closed because there has been no more activity in the 14 days since the last message. Please feel free to reopen or open a new issue if you'd still like it to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for opening the issue! |
This will be done by #28465 in ray 2.5 |
Why are these changes needed?
As mentioned in the issue it makes it consistent with other
.get
call.However, I wonder if this change might be unexpected for existing code where 0 is already used without expecting an error.
Related issue number
Closes #28465
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.