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

Prevent shutdown being blocked by finalization #38909

Merged
merged 2 commits into from
Jul 8, 2020
Merged

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Jul 8, 2020

The finalization queue can be long or constantly growing when the finalization thread is not able to
keep up with finalizable object allocation rate. This can lead to shutdown being blocked for a long
time or indefinitely.

The fix is stop the finalization loop once we enter shutdown instead of trying to empty the finalization
queue.

Fixes #314

The finalization queue can be long or constantly growing when the finalization thread is not able to
keep up with finalizable object allocation rate. This can lead to shutdown being blocked for a long
time or indefinitely.

The fix is stop the finalization loop once we enter shutdown instead of trying to empty the finalization
queue.

Fixes dotnet#314
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Worth adding a variant of the examples in #314 as a regression test (maybe with remote executor)?

@jkotas jkotas merged commit 464508b into dotnet:master Jul 8, 2020
@jkotas jkotas deleted the issue-314 branch July 8, 2020 07:23
@adamsitnik adamsitnik added this to the 5.0.0 milestone Jul 8, 2020
@adamsitnik
Copy link
Member

thank you @jkotas !

I am afraid that now @kkokosa will have to update his book ;)

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Locking finalizer keeping app alive
4 participants