Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 30, 2025

Backport of #120029 to release/10.0-rc2

The apphost ResourceUpdater doesn't dispose of the PEReader when leaveOpen is true, but the leaveOpen should only apply to the FileStream passed to the constructor. The PEReader is not accessible from the creator and cannot be disposed of elsewhere. This led to some race conditions in the SDK which caused the bundler to later fail to open the apphost.

Context: dotnet/sdk#50784

Customer Impact

  • Customer reported
  • Found internally

Found in SDK tests.

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

There is a unit test to verify the disposal behavior. The race condition appeared in a few sdk tests after updates to host writer.

Risk

Low. This fixes a simple Dispose bug in a codepath that wasn't exercised until recently (no code previously constructed the type with leaveOpen).

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

@jtschuster jtschuster changed the title [release/10.0-rc2] [release/10.0] Fix ResourceUpdater.Dispose() [release/10.0-rc2] Fix ResourceUpdater.Dispose() Sep 30, 2025
@jtschuster jtschuster requested review from agocke and sbomer September 30, 2025 18:26
@jtschuster jtschuster self-assigned this Sep 30, 2025
@jtschuster jtschuster added the area-HostModel Microsoft.NET.HostModel issues label Sep 30, 2025
Copy link
Contributor

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

@jtschuster jtschuster added the Servicing-consider Issue for next servicing release review label Sep 30, 2025
@agocke
Copy link
Member

agocke commented Sep 30, 2025

rc2 is closed

@agocke agocke closed this Sep 30, 2025
@agocke agocke deleted the backport/pr-120136-to-release/10.0-rc2 branch September 30, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-HostModel Microsoft.NET.HostModel issues Servicing-consider Issue for next servicing release review

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants