Skip to content

[release/10.0] Fix shutdown hang with IIS#65761

Merged
wtgodbe merged 5 commits intorelease/10.0from
backport/pr-65733-to-release/10.0
Mar 16, 2026
Merged

[release/10.0] Fix shutdown hang with IIS#65761
wtgodbe merged 5 commits intorelease/10.0from
backport/pr-65733-to-release/10.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Mar 12, 2026

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 = true for 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 IHostLifetime that effectively reverts ConsoleLifetime to 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?

  • Yes
  • No

Regressed from 9.0

Risk

  • High
  • Medium
  • Low

Minimal change to get things back to the state they were in before 10.0.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@github-actions github-actions bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Mar 12, 2026
@BrennanConroy BrennanConroy added the Servicing-approved Shiproom has approved the issue label Mar 12, 2026
@wtgodbe
Copy link
Copy Markdown
Member

wtgodbe commented Mar 16, 2026

Merging on red while we wait for resolution on the win-vs2022 queue

@wtgodbe wtgodbe merged commit 5a8bfbb into release/10.0 Mar 16, 2026
24 of 28 checks passed
@wtgodbe wtgodbe deleted the backport/pr-65733-to-release/10.0 branch March 16, 2026 21:28
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0.5 milestone Mar 16, 2026
@wtgodbe wtgodbe modified the milestones: 10.0.5, 10.0.6 Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants