call exit to force shutdown in case of timeout (#726)

This commit is contained in:
pan-wang 2018-03-23 15:19:00 -07:00 committed by GitHub
parent 26578f5079
commit 731f05df38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -104,11 +104,7 @@ Finished:
if (FAILED(hr))
{
STACK_STRU(strEventMsg, 256);
//
// Assumption: inprocess application shutdown will be called only at process shutdown
// Based on this assumption, we just let shutdown continue and process will exit
// Log a warning for ungraceful shutdown
//
if (SUCCEEDED(strEventMsg.SafeSnwprintf(
ASPNETCORE_EVENT_APP_SHUTDOWN_FAILURE_MSG,
m_pConfig->QueryConfigPath()->QueryStr())))
@ -118,6 +114,13 @@ Finished:
ASPNETCORE_EVENT_GRACEFUL_SHUTDOWN_FAILURE,
strEventMsg.QueryStr());
}
//
// Managed layer may block the shutdown and lead to shutdown timeout
// Assumption: only one inprocess application is hosted.
// Call process exit to force shutdown
//
exit(hr);
}
}