-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Drain requests in native instead of managed #6816
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
@@ -259,7 +265,7 @@ IN_PROCESS_APPLICATION::ExecuteApplication() | |||
if (m_waitForShutdown) | |||
{ | |||
const auto clrWaitResult = WaitForSingleObject(m_clrThread.native_handle(), m_pConfig->QueryShutdownTimeLimitInMS()); | |||
THROW_LAST_ERROR_IF(waitResult == WAIT_FAILED); | |||
THROW_LAST_ERROR_IF(clrWaitResult == WAIT_FAILED); |
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.
This is unrelated, I just noticed that we were checking the wrong wait timeout here.
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.h
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocesshandler.cpp
Outdated
Show resolved
Hide resolved
Add a test that opens a hanging connection and requests shutdown, assert that event logs are correct and it doesn't crash. |
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.h
Show resolved
Hide resolved
🆙 📅 |
src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs
Outdated
Show resolved
Hide resolved
src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs
Outdated
Show resolved
Hide resolved
src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.h
Outdated
Show resolved
Hide resolved
39080bb
to
f52cb2c
Compare
Don't merge until preview 2 ships. |
ab1abc1
to
bd4196d
Compare
@@ -97,6 +98,11 @@ public Task StopAsync(CancellationToken cancellationToken) | |||
{ | |||
_nativeApplication.StopIncomingRequests(); | |||
|
|||
_cancellationTokenRegistration = cancellationToken.Register(() => | |||
{ | |||
_shutdownSignal.TrySetResult(null); |
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.
Closure
For #6605 and #6555.
There is a race condition when shutting down and another request coming into the server. Managed perceives that there are no requests remaining, but in native, a request can be instantiated and try to call into managed, which causes app verifier to crash iisexpress/w3wp.