-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Change timeout from milliseconds to seconds in ray.wait. #3706
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
Conversation
|
Test FAILed. |
|
Test FAILed. |
|
Test PASSed. |
80f5cbb to
1b8287e
Compare
|
Test PASSed. |
|
I think we should also document it about this change. It is quite important to notify existing users about it, because this breaking change will not introduce exceptions for old code; instead users could think that |
| Returns: | ||
| copy (Filter): Copy of self""" | ||
| A copy of self. | ||
| """ |
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 needed to make this change to build the documentation locally.
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.
lgtm
|
@suquark I added a prominent warning to the API documentation. It should now look like this |
|
Test PASSed. |
|
What is the purpose of this change? Is it because we want Also, I'm afraid this change may be dangerous . As @suquark mentioned, if users didn't notice the document, their old code can still run with no exception. But If we do want to make this change. I think a safer way is to add another |
|
@raulchen The reason for this PR is that python uses function(timeout=seconds) universally when there are timeouts. We could also deal with this is to raise a deprecation warning for some grace period and keep the interpretation as milliseconds if the timeout is an int, and interpret it in seconds if it is a float (and raise no deprecation warning). Once we have done that for one release say, we change the behavior to be seconds for both ints and floats and remove the warning. |
pcmoritz
left a comment
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.
The warning looks good to me and should be enough.
|
@raulchen I agree it is definitely not ideal, but I think for Python users this will be much more intuitive. I'm hoping the warning messages will be sufficiently prominent. Shall we do the same thing in the Java API? I'm not actually sure what would be most intuitive for Java users, e.g., [1] https://www.tutorialspoint.com/java/lang/thread_sleep_millis.htm |
I don't prefer 2, because it requires 2 parameters for timeout. 1 and 3 are both okay. |

This does part of #3411. Earlier versions include #3629 and #3666. This is a breaking API change. However, we log a warning when an integer is passed into
ray.wait.