From 731f05df3801a8bc152b37ad788f4ddd1dee9714 Mon Sep 17 00:00:00 2001 From: pan-wang Date: Fri, 23 Mar 2018 15:19:00 -0700 Subject: [PATCH] call exit to force shutdown in case of timeout (#726) --- .../inprocess/inprocessapplication.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/RequestHandler/inprocess/inprocessapplication.cpp b/src/RequestHandler/inprocess/inprocessapplication.cpp index 347257d545..02bea4a9ff 100644 --- a/src/RequestHandler/inprocess/inprocessapplication.cpp +++ b/src/RequestHandler/inprocess/inprocessapplication.cpp @@ -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); } }