-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[3.1.x] Fix dotnet.exe process recovery after abnormal exit in ANCM #17103
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
Conversation
src/Servers/IIS/AspNetCoreModuleV2/OutOfProcessRequestHandler/serverprocess.cpp
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/OutOfProcessRequestHandler/serverprocess.cpp
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/OutOfProcessRequestHandler/serverprocess.cpp
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/RequestHandlerLib/requesthandler_config.h
Show resolved
Hide resolved
Co-Authored-By: Andrew Stanton-Nurse <[email protected]>
src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/AspNetCorePortTests.cs
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/OutOfProcessRequestHandler/serverprocess.cpp
Outdated
Show resolved
Hide resolved
Please apply |
…serverprocess.cpp Co-Authored-By: Brennan <[email protected]>
We'll also patch this in the 3.0 branch/sdk? |
@Tratcher from what I heard, no. |
src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/AspNetCorePortTests.cs
Show resolved
Hide resolved
for (var i = 0; i < 10; i++) | ||
{ | ||
// ANCM should eventually recover from being shutdown multiple times. | ||
response = await deploymentResult.HttpClient.GetAsync("/HelloWorld"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not a fan 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the problem here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is a bit... ugly.
src/Servers/IIS/IIS/test/Common.FunctionalTests/OutOfProcess/AspNetCorePortTests.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what's the other bool config that defaults to true?
SetCurrentDirectory and CallStartupHook both default to true. |
Do we have to wait for branding or can we merge these now? I believe our deadline for 3.1.1 is today. @aspnet/build |
These can be merged |
Fixes #17063.
Description
We introduced a regression between 2.2 and 3.0/3.1 where ANCM out of process wouldn't restart dotnet.exe on crash after restarting once. This was due to a background thread hanging when trying to close a handle for stdout. Also adds an opt-out switch to remove all redirection s.t. if there are still issues with this code-path, we can disable it.
Risk
Medium, but with reduced risk. Any change to ANCM out-of-process is always risky, but giving an opt-out switch should reduce the risk.
User impact
On application crash, ANCM normally would start a new dotnet.exe to restart dotnet. However, because a call to CloseHandle would hang, the static callback we registered wouldn't be overwritten. Therefore, on the next process exit, the callback wouldn't be fired, meaning all subsequent crashes wouldn't be detected.
Workarounds
If people expect their applications to crash or exit abnormally, they can work around this by either using ANCMv1 or enabling stdout logging. Both of these are non-ideal work arounds.
cc @Pilchie