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

[release/6.0] App does not Run as a service in a Windows Container #74188

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

eerhardt
Copy link
Member

Backport of #62452 to release/6.0

Customer Impact

When an ASP.NET service or a "generic hosted" app is executed as a Windows Service inside a Windows Container, it isn't getting the right lifetime. This makes the app not start correctly.

The reason is because inside a Windows Container, the Windows "SessionId" isn't set to 0.

Testing

Manually tested in a Windows Service on a normal machine, plus inside a Windows Container. As well as tested the method still produces false when not running as a Windows Service in both "normal" and containers.

There are no automated tests for this scenario since:

  1. We would need to install the service on the CI machine in order to run it as a service
  2. We would need to be running in a Windows Container

Risk

Low Risk. The change has been in main/7.0 since December without any complaints/concerns popping up.

Fix #70751

Removing SessionId check in IsWindowsService(). This check is not correct when the process is being run in a Windows container. The container will get a different SessionId.

Fix dotnet#52416
@eerhardt eerhardt added Servicing-consider Issue for next servicing release review area-Extensions-Hosting labels Aug 18, 2022
@eerhardt eerhardt added this to the 6.0.x milestone Aug 18, 2022
@eerhardt eerhardt requested a review from tarekgh August 18, 2022 22:16
@ghost
Copy link

ghost commented Aug 18, 2022

Tagging subscribers to this area: @dotnet/area-extensions-hosting
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #62452 to release/6.0

Customer Impact

When an ASP.NET service or a "generic hosted" app is executed as a Windows Service inside a Windows Container, it isn't getting the right lifetime. This makes the app not start correctly.

The reason is because inside a Windows Container, the Windows "SessionId" isn't set to 0.

Testing

Manually tested in a Windows Service on a normal machine, plus inside a Windows Container. As well as tested the method still produces false when not running as a Windows Service in both "normal" and containers.

There are no automated tests for this scenario since:

  1. We would need to install the service on the CI machine in order to run it as a service
  2. We would need to be running in a Windows Container

Risk

Low Risk. The change has been in main/7.0 since December without any complaints/concerns popping up.

Fix #70751

Author: eerhardt
Assignees: -
Labels:

Servicing-consider, area-Extensions-Hosting

Milestone: 6.0.x

@ghost ghost assigned eerhardt Aug 18, 2022
@carlossanlop
Copy link
Member

For the September release or for next month? cc @mmitche @danmoseley

@eerhardt
Copy link
Member Author

For the September release or for next month?

I'd be happy with whenever it can be approved and merged. There's no rush - I just have been pinged on backporting this fix multiple times, and now have a little bit of time to get it in the pipeline.

@carlossanlop
Copy link
Member

This was approved via email by Tactics.
Now we need confirmation from @mmitche that we still have runway to merge for 6.0 in September. If not, we'll have to wait.

@carlossanlop carlossanlop added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Aug 19, 2022
@carlossanlop
Copy link
Member

carlossanlop commented Sep 7, 2022

Branding was done, so the branch is open again for changes. Merging now since it got approved, OOB package authoring changes were properly added, and the CI passed.

@carlossanlop carlossanlop merged commit 84b31e8 into dotnet:release/6.0 Sep 7, 2022
carlossanlop added a commit to vseanreesermsft/runtime that referenced this pull request Oct 5, 2022
They were introduced in September in these 3 PRs:
- Microsoft.Extensions.DependencyInjection: dotnet#74366
- Microsoft.Extensions.Hosting.WindowsServices: dotnet#74188
- Microsoft.NETCore.Platforms (RIDs): dotnet#74383
carlossanlop added a commit that referenced this pull request Oct 5, 2022
* Update branding to 6.0.11

* Reseting OOB package authoring changes.
They were introduced in September in these 3 PRs:
- Microsoft.Extensions.DependencyInjection: #74366
- Microsoft.Extensions.Hosting.WindowsServices: #74188
- Microsoft.NETCore.Platforms (RIDs): #74383

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
@ghost ghost locked as resolved and limited conversation to collaborators Oct 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Hosting Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants