Fix another hang on shutdown (#51681)
authorDavid Fowler <davidfowl@gmail.com>
Thu, 22 Apr 2021 16:19:36 +0000 (09:19 -0700)
committerGitHub <noreply@github.com>
Thu, 22 Apr 2021 16:19:36 +0000 (09:19 -0700)
commitbcd3aad97b730cf32116c89f4b5228d27fd72fb5
tree26f13cc5514ef1d3673088c2c6f2f531ffc67e98
parent827474bb3280adbdcc325bbec74e64ad266ada14
Fix another hang on shutdown (#51681)

* Fix another hang on shutdown
- If SIGINT/Ctrl+C fires don't block shutdown waiting for dispose. This mechanism was intended to be a way to let application code unwind completely before exiting the process but we can cancel the the CancelKeyPress today, which means we don't need to wait for dispose to be called.
- This is a change in behavior but I can't figure out a case where ProcessExit would fire and you'd want it to wait on a dispose call *after* SIGINT/CTRL+C has fired.
src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs