Skip to content
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

[ray client] Fix ctrl-c for ray.get() by setting a short-server side timeout #14425

Merged
merged 6 commits into from
Mar 4, 2021

Conversation

ericl
Copy link
Contributor

@ericl ericl commented Mar 1, 2021

Why are these changes needed?

Ctrl-C on the client side needs to interrupt the server operation, otherwise future operations block on the original ray.get. However, this is tricky since the server is a single gRPC stream servicer. For now, workaround this with a short server-side timeout. The client breaks down long-running gets into multiple short-running polls for get up to the deadline. If the client cancels, it just needs to wait for the last operation to expire.

Future work: do this for ray.wait(), which is a bit trickier since you have to support num_returns.

@AmeerHajAli AmeerHajAli added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 1, 2021
python/ray/util/client/worker.py Show resolved Hide resolved
python/ray/tests/test_client.py Outdated Show resolved Hide resolved
python/ray/tests/test_client.py Show resolved Hide resolved
@ericl
Copy link
Contributor Author

ericl commented Mar 2, 2021

@AmeerHajAli done

@ericl ericl removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 2, 2021
Copy link
Contributor

@ijrsvt ijrsvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@ericl
Copy link
Contributor Author

ericl commented Mar 2, 2021

Seems client tests are timing out

@ericl ericl added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Mar 2, 2021
@ericl
Copy link
Contributor Author

ericl commented Mar 4, 2021

//python/ray/tests:test_actor_client_mode TIMEOUT in 3 out of 3 in 315.0s
//python/ray/tests:test_basic_2_client_mode TIMEOUT in 3 out of 3 in 315.0s

@ericl ericl merged commit 2cf4c72 into ray-project:master Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants