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

Fix timeout in client.restart #4690

Merged
merged 6 commits into from
Apr 15, 2021
Merged

Conversation

mdwint
Copy link
Contributor

@mdwint mdwint commented Apr 8, 2021

I noticed client.restart() would hang sometimes, and then I discovered the timeout passed to asyncio.wait_for being expressed as a "deadline" instead. Am I correct in assuming this is wrong?

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

Good catch @mdwint! You're correct that timeout in asyncio.wait_for is the number of seconds to wait.

Could you add a small test to distributed/tests/test_client.py to ensure that we're timing out as expected?

Also, I know it predates the changes in this PR, but could you add a call to parse_timedelta so timeout= can accept inputs like "10min", "13s" instead of just an integer or float number of seconds? For instance, here's an example of where we use parse_timedelta in another location in client.py:

timeout = parse_timedelta(timeout, "s")

@mdwint
Copy link
Contributor Author

mdwint commented Apr 9, 2021

Thanks for your guidance @jrbourbeau. I've added that test, as well as the call to parse_timedelta. Let me know if this is ok.

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

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

This looks great! Just a heads up, I pushed a small commit to use "0.5s" instead of 0.5 in the test you added to make sure the parse_timedelta addition is working as expected -- hope that's okay. Will merge once CI finishes

@jrbourbeau jrbourbeau merged commit fdfabf3 into dask:main Apr 15, 2021
@jrbourbeau
Copy link
Member

Also I noticed this was your first code contribution to this repository. Welcome!

@mdwint
Copy link
Contributor Author

mdwint commented Apr 16, 2021

Thanks, @jrbourbeau!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants