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

Let servers close faster if there are no active handlers #4805

Merged
merged 1 commit into from
May 26, 2021

Conversation

fjetter
Copy link
Member

@fjetter fjetter commented May 11, 2021

This is another marginal fix for test runtimes.

we have a hard coded grace period allowing incoming connections to finish on their own in case we want to close before we pull out the hammer.
A few things are a bit off here

  1. If there is a remote Connectionpool, these comms will always remain open and they will not close themselves unless the remote closes as well. Therefore, this will always wait no matter what
  2. If there are a bunch of comms just waiting for the remote to do stuff, there is frankly no big point in waiting. There is the edge case where we might be just in the process of reading an incoming stream but chances are very high that we will need to close something like that off anyhow
  3. The only valid reason I can see for this is that if there are active handlers still running (if that is even sensible) we'll give them a chance.

This hard coded wait period causes effectively every single await Worker.close() to block for a second if the worker has had any incoming connections before. For some tests this makes the difference between subsecond and multi second runtime.

I think we should kick this waiting time out completely but either way, this give the entire process tests and a bit of a bigger purpose than before.

@fjetter
Copy link
Member Author

fjetter commented May 14, 2021

osx failure again #4766

@fjetter fjetter force-pushed the close_server_faster branch from 345d1d9 to 9aab738 Compare May 25, 2021 10:48
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.

Thanks @fjetter! There's a small merge conflict (after merging #4733), but otherwise this PR looks good to me

@fjetter fjetter force-pushed the close_server_faster branch from 9aab738 to e300e42 Compare May 26, 2021 11:28
@fjetter fjetter merged commit 9dd7142 into dask:main May 26, 2021
douglasdavis pushed a commit to douglasdavis/distributed that referenced this pull request May 28, 2021
@fjetter fjetter mentioned this pull request May 23, 2022
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