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

Consume PosixSignal in Microsoft.Extensions.Hosting's ConsoleLifetime #55417

Closed
davidfowl opened this issue Jul 9, 2021 · 2 comments · Fixed by #56057
Closed

Consume PosixSignal in Microsoft.Extensions.Hosting's ConsoleLifetime #55417

davidfowl opened this issue Jul 9, 2021 · 2 comments · Fixed by #56057
Assignees
Milestone

Comments

@davidfowl
Copy link
Member

Given that #50527 is done, we can finally consume it in ConsoleLifetime.

The goal is to prevent hangs and deadlocks in the most common cases:

This will be on .NET 6 and up only.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 9, 2021
@dotnet-issue-labeler
Copy link

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

@ghost
Copy link

ghost commented Jul 9, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

Given that #50527 is done, we can finally consume it in ConsoleLifetime.

The goal is to prevent hangs and deadlocks in the most common cases:

This will be on .NET 6 and up only.

Author: davidfowl
Assignees: eerhardt
Labels:

area-Extensions-Hosting, untriaged

Milestone: -

@ghost ghost added this to Untriaged in ML, Extensions, Globalization, etc, POD. Jul 9, 2021
@eerhardt eerhardt removed the untriaged New issue has not been triaged by the area owner label Jul 14, 2021
@eerhardt eerhardt added this to the 6.0.0 milestone Jul 14, 2021
@ghost ghost moved this from Untriaged to 6.0.0 in ML, Extensions, Globalization, etc, POD. Jul 14, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 20, 2021
eerhardt added a commit to eerhardt/runtime that referenced this issue Jul 20, 2021
Don't listen to ProcessExit on net6.0+ in Hosting anymore. This allows for Environment.Exit to not hang the app.
Don't clobber ExitCode during ProcessExit now that SIGTERM is handled separately.

For non-net6.0 targets, only wait for the shutdown timeout, so the process doesn't hang forever.

Fix dotnet#55417
Fix dotnet#44086
Fix dotnet#50397
Fix dotnet#42224
Fix dotnet#35990
ML, Extensions, Globalization, etc, POD. automation moved this from 6.0.0 to Done Jul 22, 2021
eerhardt added a commit that referenced this issue Jul 22, 2021
* Add NetCoreAppCurrent target to Microsoft.Extensions.Hosting

* Handle SIGTERM in Hosting and handle just like SIGINT (CTRL+C)

Don't listen to ProcessExit on net6.0+ in Hosting anymore. This allows for Environment.Exit to not hang the app.
Don't clobber ExitCode during ProcessExit now that SIGTERM is handled separately.

For non-net6.0 targets, only wait for the shutdown timeout, so the process doesn't hang forever.

Fix #55417
Fix #44086
Fix #50397
Fix #42224
Fix #35990

* Remove _shutdownBlock on netcoreappcurrent, as this is no longer waited on
* Change Console.CancelKeyPress to use PosixSignalRegistration SIGINT and SIGQUIT
* Use a no-op lifetime on mobile platforms

* Add docs for shutdown
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 22, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants