some fix for handling configuration change and recycling (#539)

This commit is contained in:
pan-wang 2018-01-24 15:21:09 -08:00 committed by GitHub
parent 9c4a784891
commit d61a4ca89f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 9 deletions

View File

@ -28,8 +28,8 @@ public:
);
GLOBAL_NOTIFICATION_STATUS
OnGlobalConfigurationChange(
_In_ IGlobalConfigurationChangeProvider * pProvider
OnGlobalApplicationStop(
_In_ IHttpApplicationStopProvider * pProvider
);
private:

View File

@ -235,7 +235,14 @@ APPLICATION_MANAGER::ShutDown()
// clean up the hash table so that the application will be informed on shutdown
m_pApplicationInfoHash->Clear();
ReleaseSRWLockExclusive(&m_srwLock);
}
// stop filewatcher monitoring thread
if (m_pFileWatcher != NULL)
{
delete m_pFileWatcher;
m_pFileWatcher = NULL;
}
}

View File

@ -201,8 +201,9 @@ HRESULT
}
hr = pModuleInfo->SetGlobalNotifications(
pGlobalModule,
GL_CONFIGURATION_CHANGE | GL_STOP_LISTENING);
pGlobalModule,
GL_APPLICATION_STOP | // Configuration change trigers IIS application stop
GL_STOP_LISTENING); // worker process stop or recycle
if (FAILED(hr))
{

View File

@ -34,14 +34,14 @@ ASPNET_CORE_GLOBAL_MODULE::OnGlobalStopListening(
// Recycled the corresponding core app if its configuration changed
//
GLOBAL_NOTIFICATION_STATUS
ASPNET_CORE_GLOBAL_MODULE::OnGlobalConfigurationChange(
_In_ IGlobalConfigurationChangeProvider * pProvider
ASPNET_CORE_GLOBAL_MODULE::OnGlobalApplicationStop(
_In_ IHttpApplicationStopProvider * pProvider
)
{
UNREFERENCED_PARAMETER(pProvider);
// Retrieve the path that has changed.
PCWSTR pwszChangePath = pProvider->GetChangePath();
IHttpApplication* pApplication = pProvider->GetApplication();
PCWSTR pwszChangePath = pApplication->GetAppConfigPath();
// Test for an error.
if (NULL != pwszChangePath &&