[release/10.0] Fix shutdown hang with IIS#65761
Merged
wtgodbe merged 5 commits intorelease/10.0from Mar 16, 2026
Merged
Conversation
3 tasks
Member
|
Merging on red while we wait for resolution on the win-vs2022 queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #65733 to release/10.0
/cc @BrennanConroy
Fix shutdown hang with IIS
Description
Fixes #65436
dotnet/runtime#116652 revealed what is probably a latent bug in IIS/WAS/Windows where if
Preload Enabled = truefor your IIS application then machine shutdown can hang forever due to the default 30 second delay blocking the w3wp process from being closed which allows a new w3wp process time to start up, rinse and repeat.This PR is using a custom
IHostLifetimethat effectively revertsConsoleLifetimeto the pre-10.0 behavior of not blocking for 30 seconds to workaround whatever bug exists in the lower layers. I have pinged an IIS dev about this, and will push on a solution from that end outside of this change.Customer Impact
Multiple customers reported this issue (not sure why it happened around the 10.0.3 timeframe since the bug has been around since 10.0-p7). Impact is that machines wont shutdown if
Preload Enabled = true, so customers need to either disable preload, or add custom code to handle SIGTERM type events differently.Regression?
Regressed from 9.0
Risk
Minimal change to get things back to the state they were in before 10.0.
Verification
Packaging changes reviewed?